Online Maps v3
Loading...
Searching...
No Matches
OnlineMapsXML Class Reference

Wrapper for XML. More...

Inherits IEnumerable.

Public Member Functions

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

Static Public Member Functions

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

Properties

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

Detailed Description

Wrapper for XML.

Constructor & Destructor Documentation

◆ OnlineMapsXML() [1/2]

OnlineMapsXML.OnlineMapsXML ( string nodeName)

Creates a new element with the specified name.

Parameters
nodeNameName of element.

◆ OnlineMapsXML() [2/2]

OnlineMapsXML.OnlineMapsXML ( 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 OnlineMapsXML.A ( string attributeName)

Get an attribute by name.

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

◆ A() [2/3]

void OnlineMapsXML.A ( string attributeName,
Color32 value )

Sets the color attribute as hex value.

Parameters
attributeNameName of attribute.
valueColor

◆ A() [3/3]

void OnlineMapsXML.A ( string attributeName,
object value )

Set an named attribute.

Parameters
attributeNameName of attribute.
valueValue of attribute.

◆ A< T >()

T OnlineMapsXML.A< T > ( string attributeName)

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 OnlineMapsXML.AppendChild ( OnlineMapsXML newChild)

Append a child element.

Parameters
newChildElement.

◆ AppendChild() [2/2]

void OnlineMapsXML.AppendChild ( XmlElement newChild)

Append a child element.

Parameters
newChildElement.

◆ AppendChilds() [1/4]

void OnlineMapsXML.AppendChilds ( IEnumerable< OnlineMapsXML > list)

Append a child elements.

Parameters
listList of elements.

◆ AppendChilds() [2/4]

void OnlineMapsXML.AppendChilds ( IEnumerable< XmlNode > list)

Append a child elements.

Parameters
listList of elements.

◆ AppendChilds() [3/4]

void OnlineMapsXML.AppendChilds ( OnlineMapsXMLList list)

Append a child elements.

Parameters
listList of elements.

◆ AppendChilds() [4/4]

void OnlineMapsXML.AppendChilds ( XmlNodeList list)

Append a child elements.

Parameters
listList of elements.

◆ Create() [1/11]

OnlineMapsXML OnlineMapsXML.Create ( string nodeName)

Creates a child element with the specified name.

Parameters
nodeNameName of child element.
Returns
Child element.

◆ Create() [2/11]

OnlineMapsXML OnlineMapsXML.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/11]

OnlineMapsXML OnlineMapsXML.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/11]

OnlineMapsXML OnlineMapsXML.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() [5/11]

OnlineMapsXML OnlineMapsXML.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() [6/11]

OnlineMapsXML OnlineMapsXML.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/11]

OnlineMapsXML OnlineMapsXML.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/11]

OnlineMapsXML OnlineMapsXML.Create ( string nodeName,
OnlineMapsRange 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/11]

OnlineMapsXML OnlineMapsXML.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() [10/11]

OnlineMapsXML OnlineMapsXML.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() [11/11]

OnlineMapsXML OnlineMapsXML.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()

OnlineMapsXML OnlineMapsXML.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 OnlineMapsXML.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()

OnlineMapsXMLList OnlineMapsXML.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 OnlineMapsXML.Get ( string childName)

Get the value of element as string.

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

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

T OnlineMapsXML.Get< T > ( string childName)

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 >() [2/4]

T OnlineMapsXML.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.

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

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

T OnlineMapsXML.Get< T > ( XmlElement el)

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 >() [4/4]

T OnlineMapsXML.Get< T > ( XmlElement el,
T 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.

◆ GetNamespaceManager()

OnlineMapsXMLNamespaceManager OnlineMapsXML.GetNamespaceManager ( string prefix = null)

Get NamespaceManager for current xml node.

Parameters
prefixNamespace prefix.
Returns
NamespaceManager

◆ GetVector2dFromNode()

static OnlineMapsVector2d OnlineMapsXML.GetVector2dFromNode ( OnlineMapsXML node)
static

Converts XMLNode coordinates from Google Maps into OnlineMapsVector2d.

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

◆ GetVector2FromNode()

static Vector2 OnlineMapsXML.GetVector2FromNode ( OnlineMapsXML node)
static

Converts XMLNode coordinates from Google Maps into Vector2.

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

◆ HasChild()

bool OnlineMapsXML.HasChild ( string childName)

Checks whether the contain child element with the specified name.

Parameters
childNameName of child element
Returns
True - this contains the child with the specified name, false - otherwise.

◆ Load()

static OnlineMapsXML OnlineMapsXML.Load ( string xmlString)
static

Loads the XML from a string.

Parameters
xmlStringXML string.
Returns
First element.

◆ Remove() [1/2]

void OnlineMapsXML.Remove ( int childIndex)

Removes child element from the XML.

Parameters
childIndexIndex of child element.

◆ Remove() [2/2]

void OnlineMapsXML.Remove ( string childName)

Removes child element from the XML.

Parameters
childNameName of child element.

◆ Value()

string OnlineMapsXML.Value ( )

Gets the value of the element as string.

Returns
Value of the element as string.

◆ Value< T >()

T OnlineMapsXML.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

◆ this[int index]

OnlineMapsXML OnlineMapsXML.this[int index]
get

Get the child element by index.

Parameters
indexIndex of child element.
Returns
Child element.

◆ this[string childName]

OnlineMapsXML OnlineMapsXML.this[string childName]
get

Get the child element by name.

Parameters
childNameName of child element.
Returns
Child element.