C# Class HandCoded.Xml.Types

The Types class contains a set of functions for extracting native type values from XML XmlElement content text strings.
Much of this code has been refactored from the Logic class.
Mostrar archivo Open project: formicary/fpml-toolkit-csharp

Public Methods

Method Description
IsNegative ( XmlNode node ) : bool

Converts the value of the indicated XmlNode into a decimal value and then determines if it is negative.

IsNegative ( decimal value ) : bool

Determines if the supplied decimal value is negative.

IsNonNegative ( XmlNode node ) : bool

Converts the value of the indicated XmlNode into a decimal value and then determines if it is non-negative.

IsNonNegative ( decimal value ) : bool

Determines if the supplied decimal value is non-negative.

IsPositive ( XmlNode node ) : bool

Converts the value of the indicated XmlNode into a decimal value and then determines if it is positive.

IsPositive ( decimal value ) : bool

Determines if the supplied decimal value is positive.

Round ( decimal value, int places ) : decimal

Rounds a monetary decimal value to a given number of places.

ToBool ( XmlNode node ) : bool

Returns the value of the given XmlNode as a boolean.

ToDate ( XmlNode node ) : Date

Returns the value of the given XmlNode as a Date.

ToDateTime ( XmlNode node ) : DateTime

Returns the value of the given XmlNode as a DateTime.

ToDecimal ( XmlNode node ) : decimal

Returns the value of the given XmlNode as a decimal.

ToDouble ( XmlNode node ) : double

Returns the value of the given XmlNode as an Double.

ToInteger ( XmlNode node ) : int

Returns the value of the given XmlNode as an integer.

ToString ( XmlNode node ) : string

Returns the value of the given XmlNode as a string.

ToTime ( XmlNode node ) : Time

Returns the value of the given XmlNode as a Time.

ToToken ( XmlNode node ) : string

Returns the value of the given XmlNode as a string with all extra white space removed.

Protected Methods

Method Description
Types ( ) : System.Text

Constructs a Types instance.

Method Details

IsNegative() public static method

Converts the value of the indicated XmlNode into a decimal value and then determines if it is negative.
public static IsNegative ( XmlNode node ) : bool
node System.Xml.XmlNode The to be tested.
return bool

IsNegative() public static method

Determines if the supplied decimal value is negative.
public static IsNegative ( decimal value ) : bool
value decimal The to test.
return bool

IsNonNegative() public static method

Converts the value of the indicated XmlNode into a decimal value and then determines if it is non-negative.
public static IsNonNegative ( XmlNode node ) : bool
node System.Xml.XmlNode The to be tested.
return bool

IsNonNegative() public static method

Determines if the supplied decimal value is non-negative.
public static IsNonNegative ( decimal value ) : bool
value decimal The to test.
return bool

IsPositive() public static method

Converts the value of the indicated XmlNode into a decimal value and then determines if it is positive.
public static IsPositive ( XmlNode node ) : bool
node System.Xml.XmlNode The to be tested.
return bool

IsPositive() public static method

Determines if the supplied decimal value is positive.
public static IsPositive ( decimal value ) : bool
value decimal The to test.
return bool

Round() public static method

Rounds a monetary decimal value to a given number of places.
public static Round ( decimal value, int places ) : decimal
value decimal The to round.
places int The number of places required.
return decimal

ToBool() public static method

Returns the value of the given XmlNode as a boolean.
public static ToBool ( XmlNode node ) : bool
node System.Xml.XmlNode The containing the value.
return bool

ToDate() public static method

Returns the value of the given XmlNode as a Date.
public static ToDate ( XmlNode node ) : Date
node System.Xml.XmlNode The containing the value.
return HandCoded.Finance.Date

ToDateTime() public static method

Returns the value of the given XmlNode as a DateTime.
public static ToDateTime ( XmlNode node ) : DateTime
node System.Xml.XmlNode The containing the value.
return HandCoded.Finance.DateTime

ToDecimal() public static method

Returns the value of the given XmlNode as a decimal.
public static ToDecimal ( XmlNode node ) : decimal
node System.Xml.XmlNode The containing the value.
return decimal

ToDouble() public static method

Returns the value of the given XmlNode as an Double.
public static ToDouble ( XmlNode node ) : double
node System.Xml.XmlNode The containing the value.
return double

ToInteger() public static method

Returns the value of the given XmlNode as an integer.
public static ToInteger ( XmlNode node ) : int
node System.Xml.XmlNode The containing the value.
return int

ToString() public static method

Returns the value of the given XmlNode as a string.
public static ToString ( XmlNode node ) : string
node System.Xml.XmlNode The containing the value.
return string

ToTime() public static method

Returns the value of the given XmlNode as a Time.
public static ToTime ( XmlNode node ) : Time
node System.Xml.XmlNode The containing the value.
return HandCoded.Finance.Time

ToToken() public static method

Returns the value of the given XmlNode as a string with all extra white space removed.
public static ToToken ( XmlNode node ) : string
node System.Xml.XmlNode The containing the value.
return string

Types() protected method

Constructs a Types instance.
protected Types ( ) : System.Text
return System.Text