Company.cs 873 B

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