NameValue.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System;
  2. namespace GCAS.Dto
  3. {
  4. /// <summary>
  5. /// Can be used to store Name/Value (or Key/Value) pairs.
  6. /// </summary>
  7. [Serializable]
  8. public class NameValue : NameValue<string>
  9. {
  10. /// <summary>
  11. /// Creates a new <see cref="NameValue"/>.
  12. /// </summary>
  13. public NameValue()
  14. {
  15. }
  16. /// <summary>
  17. /// Creates a new <see cref="NameValue"/>.
  18. /// </summary>
  19. public NameValue(string name, string value)
  20. {
  21. Name = name;
  22. Value = value;
  23. }
  24. }
  25. /// <summary>
  26. /// Can be used to store Name/Value (or Key/Value) pairs.
  27. /// </summary>
  28. [Serializable]
  29. public class NameValue<T>
  30. {
  31. /// <summary>
  32. /// Name.
  33. /// </summary>
  34. public string Name { get; set; }
  35. /// <summary>
  36. /// Value.
  37. /// </summary>
  38. public T Value { get; set; }
  39. /// <summary>
  40. /// Creates a new <see cref="NameValue"/>.
  41. /// </summary>
  42. public NameValue()
  43. {
  44. }
  45. /// <summary>
  46. /// Creates a new <see cref="NameValue"/>.
  47. /// </summary>
  48. public NameValue(string name, T value)
  49. {
  50. Name = name;
  51. Value = value;
  52. }
  53. }
  54. }