Company.cs 894 B

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