using System.Xml; namespace Server.Accounting { public class AccountTag { /// /// Gets or sets the name of this tag. /// public string Name { get; set; } /// /// Gets or sets the value of this tag. /// public string Value { get; set; } /// /// Constructs a new AccountTag instance with a specific name and value. /// /// Initial name. /// Initial value. public AccountTag( string name, string value ) { Name = name; Value = value; } /// /// Deserializes an AccountTag instance from an xml element. /// /// The XmlElement instance from which to deserialize. public AccountTag( XmlElement node ) { Name = Utility.GetAttribute( node, "name", "empty" ); Value = Utility.GetText( node, "" ); } /// /// Serializes this AccountTag instance to an XmlTextWriter. /// /// The XmlTextWriter instance from which to serialize. public void Save( XmlTextWriter xml ) { xml.WriteStartElement( "tag" ); xml.WriteAttributeString( "name", Name ); xml.WriteString( Value ); xml.WriteEndElement(); } } }