Tagging.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System.Collections.Generic;
  2. using System.Xml.Serialization;
  3. namespace COSXML.Model.Tag
  4. {
  5. [XmlRoot("Tagging")]
  6. public sealed class Tagging
  7. {
  8. [XmlElement("TagSet")]
  9. public TagSet tagSet;
  10. public Tagging()
  11. {
  12. this.tagSet = new TagSet();
  13. }
  14. public void AddTag(string key, string value)
  15. {
  16. this.tagSet.tags.Add(new Tag(key, value));
  17. }
  18. public sealed class TagSet
  19. {
  20. [XmlElement("Tag")]
  21. public List<Tag> tags;
  22. public TagSet()
  23. {
  24. this.tags = new List<Tag>();
  25. }
  26. }
  27. public sealed class Tag
  28. {
  29. [XmlElement("Key")]
  30. public string key;
  31. [XmlElement("Value")]
  32. public string value;
  33. public Tag()
  34. {
  35. }
  36. public Tag(string key, string value)
  37. {
  38. this.key = key;
  39. this.value = value;
  40. }
  41. }
  42. }
  43. }