Advertisement
Guest User

Untitled

a guest
Nov 4th, 2017
108
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None
  1.     public class Tag<T>
  2.     {
  3.         [XmlAttribute(AttributeName = "value")]
  4.         public T Value { get; set; }
  5.  
  6.         public static implicit operator Tag<T>(T value)
  7.         {
  8.             return new Tag<T> { Value = value };
  9.         }
  10.     }
  11.  
  12.     [XmlRoot(ElementName = "document")]
  13.     public class Document
  14.     {
  15.         [XmlElement(ElementName = "tag1")]
  16.         public Tag<int> Tag1 { get; set; }
  17.         [XmlElement(ElementName = "tag2")]
  18.         public Tag<string> Tag2 { get; set; }
  19.         [XmlElement(ElementName = "tag3")]
  20.         public Tag<DateTime> Tag3 { get; set; }
  21.         [XmlElement(ElementName = "tag4")]
  22.         public Tag<int> Tag4 { get; set; }
  23.         [XmlElement(ElementName = "tag5")]
  24.         public Tag<DateTime> Tag5 { get; set; }
  25.         [XmlElement(ElementName = "tag6")]
  26.         public Tag<string> Tag6 { get; set; }
  27.         [XmlElement(ElementName = "tag7")]
  28.         public Tag<decimal> Tag7 { get; set; }
  29.     }
Advertisement
RAW Paste Data Copied
Advertisement