Table of Contents

Class ADTObjectCollectionT<T>

Namespace
ArcanaDevelopment.adTempus.Client.Collections
Assembly
ArcanaDevelopment.adTempus.Client.dll
public abstract class ADTObjectCollectionT<T> : ObjectCollectionT<T> where T : ADTObject

Type Parameters

NameDescription
T
Inheritance
object
ADTObjectCollectionT<T>
Derived

Constructors

ADTObjectCollectionT()

protected ADTObjectCollectionT()

Fields

NavigatorName

protected string NavigatorName

Field Value

string

ParentFacade

protected ADTObject ParentFacade

Field Value

ADTObject

Properties

this[object]

Gets the object with the specified OID or numeric index.

public virtual T this[object index] { get; }

Parameters

NameTypeDescription
index object

Property Value

T

Remarks

Returns null if no object with the requested OID is found.

Exceptions

ArgumentOutOfRangeException

Thrown if index is a numeric value that is outside the bounds of the collection.

ArgumentException

Thrown if index is not an integer, string, or OID.

See Also

Methods

Add(T)

Adds an item to the System.Collections.Generic.ICollection<T>.

public override void Add(T newVal)

Parameters

NameTypeDescription
newVal T

Exceptions

NotSupportedException

The System.Collections.Generic.ICollection<T> is read-only.

CanAdd(T)

protected virtual bool CanAdd(T obj)

Parameters

NameTypeDescription
obj T

Returns

bool

CanRemove(T)

protected virtual bool CanRemove(T obj)

Parameters

NameTypeDescription
obj T

Returns

bool

Clear()

Removes all items from the System.Collections.Generic.ICollection<T>.

public override void Clear()

Exceptions

NotSupportedException

The System.Collections.Generic.ICollection<T> is read-only.

Contains(OID)

public virtual bool Contains(OID targetOID)

Parameters

NameTypeDescription
targetOID OID

Returns

bool

CreateCollectionReadOnlyException()

public static NotSupportedException CreateCollectionReadOnlyException()

Returns

NotSupportedException

EnsureCanReferenceAndThrow(ADTObject)

protected void EnsureCanReferenceAndThrow(ADTObject objectToReference)

Parameters

NameTypeDescription
objectToReference ADTObject

GetAt(int)

public T GetAt(int index)

Parameters

NameTypeDescription
index int

Returns

T

GetEnumerator()

Returns an enumerator that iterates through the collection.

public virtual IEnumerator<T> GetEnumerator()

Returns

IEnumerator<T>

An enumerator that can be used to iterate through the collection.

GetItem(object)

Gets the object with the specified OID or numeric index.

public virtual T GetItem(object index)

Parameters

NameTypeDescription
index object

Returns

T

Remarks

Returns null if no object with the requested OID is found.

Exceptions

ArgumentOutOfRangeException

Thrown if index is a numeric value that is outside the bounds of the collection.

ArgumentException

Thrown if index is not an integer, string, or OID.

GetItemByOID(OID)

Returns the item in the collection that matches the specified OID.

protected virtual T GetItemByOID(OID targetOID)

Parameters

NameTypeDescription
targetOID OID

Returns

T

The requested item, or null if the item does not exist in the collection.

Remarks

This method is used by both this[], GetItem, Contains, Remove, etc. Override it to modify the way searches by OID are done.

For example, a collection of joins may want to be able to match on the OID of the join object or one of the objects the join points to.

GetObject(OID)

Gets the object with the specified OID.

public virtual ADTObject GetObject(OID oid)

Parameters

NameTypeDescription
oid OID

The OID of the object to get from the collection.

Returns

ADTObject

The requested object, or null (Nothing) if the object is not found in the collection.

Insert(int, T)

public override void Insert(int index, T newVal)

Parameters

NameTypeDescription
index int
newVal T

OnObjectAdded(T, int)

protected virtual void OnObjectAdded(T newVal, int index)

Parameters

NameTypeDescription
newVal T
index int

OnObjectRemoved(T)

protected virtual void OnObjectRemoved(T newVal)

Parameters

NameTypeDescription
newVal T

Remove(object)

public void Remove(object index)

Parameters

NameTypeDescription
index object

Remove(T)

Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection<T>.

public override bool Remove(T ObjectToRemove)

Parameters

NameTypeDescription
ObjectToRemove T

Returns

bool

true if item was successfully removed from the System.Collections.Generic.ICollection<T>; otherwise, false. This method also returns false if item is not found in the original System.Collections.Generic.ICollection<T>.

Exceptions

NotSupportedException

The System.Collections.Generic.ICollection<T> is read-only.

RemoveAt(int)

public override void RemoveAt(int index)

Parameters

NameTypeDescription
index int

RemoveByOID(OID)

public virtual bool RemoveByOID(OID targetOID)

Parameters

NameTypeDescription
targetOID OID

Returns

bool

RenumberContents()

Updates sequence numbers for all items in collection. This method must be explicitly called to renumber contents.

public virtual void RenumberContents()

Remarks

RenumberContents iterates through all items in the collection if they implement the ISequencedCollectionMember. If so, ISequencedCollectionMember.SetSequenceNumber is called. This is used, for example, in a collection of JobSteps, where the StepNumber needs to be set on each step to keep them in the correct order.

UpdateFrom(IEnumerable<T>)

Updates the collection to match the specified source by adding, deleting, and reordering contents as needed.

public virtual void UpdateFrom(IEnumerable<T> src)

Parameters

NameTypeDescription
src IEnumerable<T>

UpdateFrom(IEnumerable, bool)

Updates the collection to match the specified source by adding, deleting, and reordering contents as needed.

public virtual void UpdateFrom(IEnumerable source, bool throwOnMismatch)

Parameters

NameTypeDescription
source IEnumerable

An enumerable collection to add from

throwOnMismatch bool

If true, the method throws an InvalidOperationException if it encounters an item that is not of type T. If false, invalid items are silently ignored.

Events

EntityAdded

public event ADTObjectCollectionT<T>.CollectionOperationEvent EntityAdded

Event Type

ADTObjectCollectionT<T>.CollectionOperationEvent

EntityRemoved

public event ADTObjectCollectionT<T>.CollectionOperationEvent EntityRemoved

Event Type

ADTObjectCollectionT<T>.CollectionOperationEvent

ObjectAdding

public event ADTObjectCollectionT<T>.CancelableCollectionOperationEvent ObjectAdding

Event Type

ADTObjectCollectionT<T>.CancelableCollectionOperationEvent

ObjectRemoving

public event ADTObjectCollectionT<T>.CancelableCollectionOperationEvent ObjectRemoving

Event Type

ADTObjectCollectionT<T>.CancelableCollectionOperationEvent

Inherited Members