Company.cs 1012 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. namespace Jint.Tests.Runtime.Domain
  2. {
  3. public class Company : ICompany, IComparable<ICompany>
  4. {
  5. private string _name;
  6. private readonly Dictionary<string, string> _dictionary = new Dictionary<string, string>()
  7. {
  8. {"key", "value"}
  9. };
  10. public Company(string name)
  11. {
  12. _name = name;
  13. }
  14. string ICompany.Name
  15. {
  16. get => _name;
  17. set => _name = value;
  18. }
  19. string ICompany.this[string key]
  20. {
  21. get => _dictionary[key];
  22. set => _dictionary[key] = value;
  23. }
  24. public string Item => "item thingie";
  25. int IComparable<ICompany>.CompareTo(ICompany other)
  26. {
  27. return string.Compare(_name, other.Name, StringComparison.CurrentCulture);
  28. }
  29. public IEnumerable<char> GetNameChars()
  30. {
  31. foreach (var c in _name)
  32. {
  33. yield return c;
  34. }
  35. }
  36. }
  37. }