Scripts/Accounting/Account.cs
/// <summary>
/// Deserializes a list of IPAddress values from an xml element.
/// </summary>
/// <param name="node">The XmlElement from which to deserialize.</param>
/// <returns>Address list. Value will never be null.</returns>
Deserializes a list of IPAddress values from an xml element.
Deserializes a list of IPAddress values from an xml element .
public static IPAddress[] LoadAddressList( XmlElement node )
		{
			IPAddress[] list;
			XmlElement addressList = node["addressList"];
			if ( addressList != null )
			{
				int count = Utility.GetXMLInt32( Utility.GetAttribute( addressList, "count", "0" ), 0 );
				list = new IPAddress[count];
				count = 0;
				foreach ( XmlElement ip in addressList.GetElementsByTagName( "ip" ) )
				{
					if ( count < list.Length )
					{
						IPAddress address;
						if( IPAddress.TryParse( Utility.GetText( ip, null ), out address ) )
						{
							list[count] = Utility.Intern( address );
							count++;
						}
					}
				}
				if ( count != list.Length )
				{
					IPAddress[] old = list;
					list = new IPAddress[count];
					for ( int i = 0; i < count && i < old.Length; ++i )
						list[i] = old[i];
				}
			}
			else
			{
				list = new IPAddress[0];
			}
			return list;
		}
public static IPAddress [ ] LoadAddressList ( XmlElement node ) { IPAddress [ ] list ; XmlElement addressList = node [ " " ] ; if ( addressList != null ) { int count = Utility . GetXMLInt32 ( Utility . GetAttribute ( addressList , " " , " " ) , 0 ) ; list = new IPAddress [ count ] ; count = 0 ; foreach ( XmlElement ip in addressList . GetElementsByTagName ( " " ) ) { if ( count < list . Length ) { IPAddress address ; if ( IPAddress . TryParse ( Utility . GetText ( ip , null ) , out address ) ) { list [ count ] = Utility . Intern ( address ) ; count ++ ; } } } if ( count != list . Length ) { IPAddress [ ] old = list ; list = new IPAddress [ count ] ; for ( int i = 0 ; i < count && i < old . Length ; ++ i ) list [ i ] = old [ i ] ; } } else { list = new IPAddress [ 0 ] ; } return list ; }
Deserializes a list of IPAddress values from an xml element.
Deserializes a list of IPAddress values from an xml element .
Address list. Value will never be null.
Address list . Value will never be null .
node
XmlElement
The XmlElement from which to deserialize.
The XmlElement from which to deserialize .