Real World Terrain  v4.1
InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML Class Reference

Wrapper for XML. More...

Inherits IEnumerable.

Public Member Functions

 RealWorldTerrainXML ()
 Creates an empty element. More...
 
 RealWorldTerrainXML (string nodeName)
 Creates a new element with the specified name. More...
 
 RealWorldTerrainXML (XmlElement xmlElement)
 Creates a new element based on the XmlElement. More...
 
string A (string attributeName)
 Get an attribute by name. More...
 
A< T > (string attributeName)
 Get an attribute by name, and return as the specified type. More...
 
void A (string attributeName, object value)
 Set an named attribute. More...
 
void A (string attributeName, Color32 value)
 Sets the color attribute as hex value. More...
 
void AppendChild (XmlElement newChild)
 Append a child element. More...
 
void AppendChild (RealWorldTerrainXML newChild)
 Append a child element. More...
 
void AppendChilds (IEnumerable< XmlNode > list)
 Append a child elements. More...
 
void AppendChilds (IEnumerable< RealWorldTerrainXML > list)
 Append a child elements. More...
 
void AppendChilds (XmlNodeList list)
 Append a child elements. More...
 
void AppendChilds (RealWorldTerrainXMLList list)
 Append a child elements. More...
 
RealWorldTerrainXML Create (string nodeName)
 Creates a child element with the specified name. More...
 
RealWorldTerrainXML Create (string nodeName, bool value)
 Creates a child element with the specified name and value. More...
 
RealWorldTerrainXML Create (string nodeName, Color32 value)
 Creates a child element with the specified name and value. More...
 
RealWorldTerrainXML Create (string nodeName, float value)
 Creates a child element with the specified name and value. More...
 
RealWorldTerrainXML Create (string nodeName, double value)
 Creates a child element with the specified name and value. More...
 
RealWorldTerrainXML Create (string nodeName, int value)
 Creates a child element with the specified name and value. More...
 
RealWorldTerrainXML Create (string nodeName, Object value)
 Creates a child element with the specified name and value. More...
 
RealWorldTerrainXML Create (string nodeName, string value)
 Creates a child element with the specified name and value. More...
 
RealWorldTerrainXML Create (string nodeName, Vector2 value)
 Creates a child element with the specified name and value. More...
 
RealWorldTerrainXML Create (string nodeName, Vector3 value)
 Creates a child element with the specified name and value. More...
 
RealWorldTerrainXML Find (string xpath, System.Xml.XmlNamespaceManager nsmgr=null)
 Find a child at the specified XPath. More...
 
Find< T > (string xpath, System.Xml.XmlNamespaceManager nsmgr=null)
 Find a child at the specified XPath, and return value as the specified type. More...
 
RealWorldTerrainXMLList FindAll (string xpath, System.Xml.XmlNamespaceManager nsmgr=null)
 Finds all childs at the specified XPath. More...
 
string Get (string childName)
 Get the value of element as string. More...
 
Get< T > (XmlElement el)
 Get the value of element as the specified type. More...
 
Get< T > (XmlElement el, T defaultValue)
 Get the value of element as the specified type or default value if the child is not found. More...
 
Get< T > (string childName)
 Get the value of child element as the specified type. More...
 
Get< T > (string childName, T defaultValue)
 Get the value of child element as the specified type or default value if the child is not found. More...
 
RealWorldTerrainXMLNamespaceManager GetNamespaceManager (string prefix=null)
 Get NamespaceManager for current xml node. More...
 
void Remove ()
 Removes this element from the XML. More...
 
void Remove (string childName)
 Removes child element from the XML. More...
 
void Remove (int childIndex)
 Removes child element from the XML. More...
 
string Value ()
 Gets the value of the element as string. More...
 
Value< T > ()
 Gets the value of the element as the specified type. More...
 

Static Public Member Functions

static Vector2 GetVector2FromNode (RealWorldTerrainXML node)
 Converts XMLNode coordinates from Google Maps into Vector2. More...
 
static RealWorldTerrainXML Load (string xmlString)
 Loads the XML from a string. More...
 

Properties

string? name [get]
 Name of the node. More...
 
int? count [get]
 The number of child nodes. More...
 
bool isNull [get]
 Checks whether the contents of the node. More...
 
XmlDocument document [get]
 Reference to XmlDocument. More...
 
XmlElement element [get]
 Reference to XmlElement. More...
 
bool hasAttributes [get]
 Gets a value indicating whether the current node has any attributes. More...
 
bool hasChildNodes [get]
 Gets a value indicating the presence of the child nodes from the current node. More...
 
string? outerXml [get]
 Content of node as string. More...
 
RealWorldTerrainXML this[int index] [get]
 Get the child element by index. More...
 
RealWorldTerrainXML this[string childName] [get]
 Get the child element by name. More...
 

Detailed Description

Wrapper for XML.

Constructor & Destructor Documentation

◆ RealWorldTerrainXML() [1/3]

InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.RealWorldTerrainXML ( )

Creates an empty element.

◆ RealWorldTerrainXML() [2/3]

InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.RealWorldTerrainXML ( string  nodeName)

Creates a new element with the specified name.

Parameters
nodeNameName of element.

◆ RealWorldTerrainXML() [3/3]

InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.RealWorldTerrainXML ( XmlElement  xmlElement)

Creates a new element based on the XmlElement.

Parameters
xmlElementXmlElement for which will create the wrapper.

Member Function Documentation

◆ A() [1/3]

string InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.A ( string  attributeName)

Get an attribute by name.

Parameters
attributeNameName of attribute.
Returns
Value of attribute as string.

◆ A() [2/3]

void InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.A ( string  attributeName,
object  value 
)

Set an named attribute.

Parameters
attributeNameName of attribute.
valueValue of attribute.

◆ A() [3/3]

void InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.A ( string  attributeName,
Color32  value 
)

Sets the color attribute as hex value.

Parameters
attributeNameName of attribute.
valueColor

◆ A< T >()

Get an attribute by name, and return as the specified type.

Template Parameters
TType of attribute.
Parameters
attributeNameName of attribute.
Returns
Value of attribute as specified type.

◆ AppendChild() [1/2]

void InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.AppendChild ( XmlElement  newChild)

Append a child element.

Parameters
newChildElement.

◆ AppendChild() [2/2]

void InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.AppendChild ( RealWorldTerrainXML  newChild)

Append a child element.

Parameters
newChildElement.

◆ AppendChilds() [1/4]

void InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.AppendChilds ( IEnumerable< XmlNode >  list)

Append a child elements.

Parameters
listList of elements.

◆ AppendChilds() [2/4]

void InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.AppendChilds ( IEnumerable< RealWorldTerrainXML list)

Append a child elements.

Parameters
listList of elements.

◆ AppendChilds() [3/4]

void InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.AppendChilds ( XmlNodeList  list)

Append a child elements.

Parameters
listList of elements.

◆ AppendChilds() [4/4]

void InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.AppendChilds ( RealWorldTerrainXMLList  list)

Append a child elements.

Parameters
listList of elements.

◆ Create() [1/10]

RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Create ( string  nodeName)

Creates a child element with the specified name.

Parameters
nodeNameName of child element.
Returns
Child element.

◆ Create() [2/10]

RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Create ( string  nodeName,
bool  value 
)

Creates a child element with the specified name and value.

Parameters
nodeNameName of child element.
valueValue of child element.
Returns
Child element.

◆ Create() [3/10]

RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Create ( string  nodeName,
Color32  value 
)

Creates a child element with the specified name and value.

Parameters
nodeNameName of child element.
valueValue of child element.
Returns
Child element.

◆ Create() [4/10]

RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Create ( string  nodeName,
float  value 
)

Creates a child element with the specified name and value.

Parameters
nodeNameName of child element.
valueValue of child element.
Returns
Child element.

◆ Create() [5/10]

RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Create ( string  nodeName,
double  value 
)

Creates a child element with the specified name and value.

Parameters
nodeNameName of child element.
valueValue of child element.
Returns
Child element.

◆ Create() [6/10]

RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Create ( string  nodeName,
int  value 
)

Creates a child element with the specified name and value.

Parameters
nodeNameName of child element.
valueValue of child element.
Returns
Child element.

◆ Create() [7/10]

RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Create ( string  nodeName,
Object  value 
)

Creates a child element with the specified name and value.

Parameters
nodeNameName of child element.
valueValue of child element.
Returns
Child element.

◆ Create() [8/10]

RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Create ( string  nodeName,
string  value 
)

Creates a child element with the specified name and value.

Parameters
nodeNameName of child element.
valueValue of child element.
Returns
Child element.

◆ Create() [9/10]

RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Create ( string  nodeName,
Vector2  value 
)

Creates a child element with the specified name and value.

Parameters
nodeNameName of child element.
valueValue of child element.
Returns
Child element.

◆ Create() [10/10]

RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Create ( string  nodeName,
Vector3  value 
)

Creates a child element with the specified name and value.

Parameters
nodeNameName of child element.
valueValue of child element.
Returns
Child element.

◆ Find()

RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Find ( string  xpath,
System.Xml.XmlNamespaceManager  nsmgr = null 
)

Find a child at the specified XPath.

Parameters
xpathXPath string.
nsmgrAn XmlNamespaceManager to use for resolving namespaces for prefixes in the XPath expression.
Returns
Child element.

◆ Find< T >()

T InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Find< T > ( string  xpath,
System.Xml.XmlNamespaceManager  nsmgr = null 
)

Find a child at the specified XPath, and return value as the specified type.

Template Parameters
TType of child element.
Parameters
xpathXPath string.
nsmgrAn XmlNamespaceManager to use for resolving namespaces for prefixes in the XPath expression.
Returns
Value of child element as the specified type.

◆ FindAll()

RealWorldTerrainXMLList InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.FindAll ( string  xpath,
System.Xml.XmlNamespaceManager  nsmgr = null 
)

Finds all childs at the specified XPath.

Parameters
xpathXPath string.
nsmgrAn XmlNamespaceManager to use for resolving namespaces for prefixes in the XPath expression.
Returns
List of the elements.

◆ Get()

string InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Get ( string  childName)

Get the value of element as string.

Parameters
childNameName of child.
Returns
Value of element as string.

◆ Get< T >() [1/4]

Get the value of element as the specified type.

Template Parameters
TType of element
Parameters
elElement
Returns
Value of element as the specified type.

◆ Get< T >() [2/4]

T InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Get< T > ( XmlElement  el,
defaultValue 
)

Get the value of element as the specified type or default value if the child is not found.

Template Parameters
TType of element
Parameters
elElement
defaultValueDefault value
Returns
Value of element as the specified type or default value.

◆ Get< T >() [3/4]

Get the value of child element as the specified type.

Template Parameters
TType of child element.
Parameters
childNameName of child.
Returns
Value of element as the specified type.

◆ Get< T >() [4/4]

T InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Get< T > ( string  childName,
defaultValue 
)

Get the value of child element as the specified type or default value if the child is not found.

Template Parameters
TType of child element.
Parameters
childNameName of child.
defaultValueDefault value.
Returns
Value of element as the specified type or default value.

◆ GetNamespaceManager()

RealWorldTerrainXMLNamespaceManager InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.GetNamespaceManager ( string  prefix = null)

Get NamespaceManager for current xml node.

Parameters
prefixNamespace prefix.
Returns
NamespaceManager

◆ GetVector2FromNode()

static Vector2 InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.GetVector2FromNode ( RealWorldTerrainXML  node)
static

Converts XMLNode coordinates from Google Maps into Vector2.

Parameters
nodeXMLNode coordinates from Google Maps.
Returns
Coordinates as Vector2.

◆ Load()

static RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Load ( string  xmlString)
static

Loads the XML from a string.

Parameters
xmlStringXML string.
Returns
First element.

◆ Remove() [1/3]

void InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Remove ( )

Removes this element from the XML.

◆ Remove() [2/3]

void InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Remove ( string  childName)

Removes child element from the XML.

Parameters
childNameName of child element.

◆ Remove() [3/3]

void InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Remove ( int  childIndex)

Removes child element from the XML.

Parameters
childIndexIndex of child element.

◆ Value()

string InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.Value ( )

Gets the value of the element as string.

Returns
Value of the element as string.

◆ Value< T >()

Gets the value of the element as the specified type.

Template Parameters
TType of element.
Returns
Value as the specified type.

Property Documentation

◆ count

int? InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.count
get

The number of child nodes.

◆ document

XmlDocument InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.document
get

Reference to XmlDocument.

◆ element

XmlElement InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.element
get

Reference to XmlElement.

◆ hasAttributes

bool InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.hasAttributes
get

Gets a value indicating whether the current node has any attributes.

◆ hasChildNodes

bool InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.hasChildNodes
get

Gets a value indicating the presence of the child nodes from the current node.

◆ isNull

bool InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.isNull
get

Checks whether the contents of the node.

◆ name

string? InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.name
get

Name of the node.

◆ outerXml

string? InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.outerXml
get

Content of node as string.

◆ this[int index]

RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.this[int index]
get

Get the child element by index.

Parameters
indexIndex of child element.
Returns
Child element.

◆ this[string childName]

RealWorldTerrainXML InfinityCode.RealWorldTerrain.XML.RealWorldTerrainXML.this[string childName]
get

Get the child element by name.

Parameters
childNameName of child element.
Returns
Child element.