Class XMLcollection<ParentObjectType, ChildObjectType>
- Namespace
- PolarStudio
- Assembly
- PolarStudio.dll
A collection of objects with their definition stored in XML
public class XMLcollection<ParentObjectType, ChildObjectType> : IEnumerable where ParentObjectType : XMLparent where ChildObjectType : XMLobject<ParentObjectType>, new()
Type Parameters
ParentObjectType
The type of the parent.
ChildObjectType
The type of the childs.
- Inheritance
-
XMLcollection<ParentObjectType, ChildObjectType>
- Implements
- Inherited Members
- Extension Methods
Properties
Count
Gets the number of elements in this collection.
public int Count { get; }
Property Value
this[object]
Default property to get an element by 1-based index or guid.
public ChildObjectType this[object pIndex] { get; }
Parameters
pIndex
objectThe 1 based index or guid.
Property Value
- ChildObjectType
The item. Throws an exception if out of bounds or not found.
ParentObject
Gets the parent of the collection.
public ParentObjectType ParentObject { get; }
Property Value
- ParentObjectType
Methods
ContainsKey(string)
Returns a boolean indicating an item with the specified guid is found in this collection.
public bool ContainsKey(string pIndex)
Parameters
pIndex
stringThe guid to look for.
Returns
- bool
A boolean indicating an element with the specified guid was found.
Exists(string)
Returns a boolean indicating an item with the specified guid is found in this collection.
public object Exists(string pGuid)
Parameters
pGuid
stringThe guid to look for.
Returns
- object
A boolean indicating an element with the specified guid was found.
GetEnumerator()
The enumerator.
public IEnumerator GetEnumerator()
Returns
- IEnumerator
The enumerator.
ItemByName(string)
Gets a child object by the given name.
public ChildObjectType ItemByName(string pName)
Parameters
pName
stringThe name of the child object to get (not case sensitive).
Returns
- ChildObjectType
The found child object or Nothing if not found.
TryGet(object, ChildObjectType)
Tries to get an element by 1-based index or guid.
public ChildObjectType TryGet(object pIndex, ChildObjectType pDefaultValue = null)
Parameters
pIndex
objectThe 1 based index or guid.
pDefaultValue
ChildObjectTypeA default value to return if not found.
Returns
- ChildObjectType
The item. Returns the specified default value if out of bounds or not found.