Table of Contents

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

int

this[object]

Default property to get an element by 1-based index or guid.

public ChildObjectType this[object pIndex] { get; }

Parameters

pIndex object

The 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 string

The 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 string

The 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 string

The 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 object

The 1 based index or guid.

pDefaultValue ChildObjectType

A default value to return if not found.

Returns

ChildObjectType

The item. Returns the specified default value if out of bounds or not found.