using System; using System.Xml; namespace Server.Accounting { public class AccountTag { private string m_Name, m_Value; /// /// Gets or sets the name of this tag. /// public string Name { get{ return m_Name; } set{ m_Name = value; } } /// /// Gets or sets the value of this tag. /// public string Value { get{ return m_Value; } set{ m_Value = value; } } /// /// Constructs a new AccountTag instance with a specific name and value. /// /// Initial name. /// Initial value. public AccountTag( string name, string value ) { m_Name = name; m_Value = value; } /// /// Deserializes an AccountTag instance from an xml element. /// /// The XmlElement instance from which to deserialize. public AccountTag( XmlElement node ) { m_Name = Utility.GetAttribute( node, "name", "empty" ); m_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", m_Name ); xml.WriteString( m_Value ); xml.WriteEndElement(); } } }