C# Class AGS.Types.SerializeUtils

Datei anzeigen Open project: adventuregamestudio/ags Class Usage Examples

Public Methods

Method Description
CompatStringToResolution ( String s ) : Size
DeserializeFromXML ( object obj, XmlNode node ) : void
GetAttributeInt ( XmlNode node, string attrName ) : int
GetAttributeString ( XmlNode node, string attrName ) : string
GetChildNodes ( XmlNode parent, string elementName ) : XmlNodeList

Wrapper function for SelectSingleNode that throws an exception mentioning the node name if it is not found. Returns the node's children if successful.

GetElementString ( XmlNode node, string elementName ) : string

Wrapper function for SelectSingleNode that throws an exception mentioning the node name if it is not found. Returns the node text if successful.

GetElementStringOrDefault ( XmlNode node, string elementName, string defaultValue ) : string

Wrapper function for SelectSingleNode that returns the node text or some default text if it does not exist.

ResolutionToCompatString ( Size size ) : String
SerializeToXML ( object obj, XmlTextWriter writer ) : void
SerializeToXML ( object obj, XmlTextWriter writer, bool writeEndElement ) : void

Method Details

CompatStringToResolution() public static method

public static CompatStringToResolution ( String s ) : Size
s String
return System.Drawing.Size

DeserializeFromXML() public static method

public static DeserializeFromXML ( object obj, XmlNode node ) : void
obj object
node System.Xml.XmlNode
return void

GetAttributeInt() public static method

public static GetAttributeInt ( XmlNode node, string attrName ) : int
node System.Xml.XmlNode
attrName string
return int

GetAttributeString() public static method

public static GetAttributeString ( XmlNode node, string attrName ) : string
node System.Xml.XmlNode
attrName string
return string

GetChildNodes() public static method

Wrapper function for SelectSingleNode that throws an exception mentioning the node name if it is not found. Returns the node's children if successful.
public static GetChildNodes ( XmlNode parent, string elementName ) : XmlNodeList
parent System.Xml.XmlNode
elementName string
return System.Xml.XmlNodeList

GetElementString() public static method

Wrapper function for SelectSingleNode that throws an exception mentioning the node name if it is not found. Returns the node text if successful.
public static GetElementString ( XmlNode node, string elementName ) : string
node System.Xml.XmlNode
elementName string
return string

GetElementStringOrDefault() public static method

Wrapper function for SelectSingleNode that returns the node text or some default text if it does not exist.
public static GetElementStringOrDefault ( XmlNode node, string elementName, string defaultValue ) : string
node System.Xml.XmlNode
elementName string
defaultValue string
return string

ResolutionToCompatString() public static method

public static ResolutionToCompatString ( Size size ) : String
size System.Drawing.Size
return String

SerializeToXML() public static method

public static SerializeToXML ( object obj, XmlTextWriter writer ) : void
obj object
writer System.Xml.XmlTextWriter
return void

SerializeToXML() public static method

public static SerializeToXML ( object obj, XmlTextWriter writer, bool writeEndElement ) : void
obj object
writer System.Xml.XmlTextWriter
writeEndElement bool
return void