GenericEnumerable<T>

GenericEnumerable<T> Generic Class

The GenericEnumerable takes a delegate which accesses items in a Array-like collection by index and allows iteration through enumeration.

Syntax

public class GenericEnumerable<T> : IEnumerable<T>
where T : class

Type Parameters

T
The type of objects returned by Sansar.Utility.GenericEnumerable`1.GetItem

Remarks

This is used by some API methods to allow for enumerations on some colletions.

Requirements

Namespace: Sansar.Utility
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

Members

See Also: Inherited members from object.

Public Constructors

 
Initializes the enumerable with an item count and an accessor delegate.

Public Properties

[read-only]
 
Count uint . The total number of items in the collection.

Public Methods

 
GetEnumerator () : IEnumerator<T>
Returns an enumerator that iterates through the collection.

Explicitly Implemented Interface Members

 
IEnumerable.GetEnumerator Returns an enumerator that iterates through the collection.

Member Details

GenericEnumerable Constructor

Initializes the enumerable with an item count and an accessor delegate.

Syntax

public GenericEnumerable (uint count, GenericEnumerable<T>.GetItem getItem)

Parameters

count
Total number of items in the collection.
getItem
Delegate which retrieves an item from a collection by index.

Remarks

If the item count changes or items change index the enumeration may be invalidated.

Requirements

Namespace: Sansar.Utility
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

Count Property

The total number of items in the collection.

Syntax

public uint Count { get; }

Value

The total number of items in the collection.

Remarks

Set by the constructor.

Requirements

Namespace: Sansar.Utility
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

GetEnumerator Method

Returns an enumerator that iterates through the collection.

Syntax

public IEnumerator<T> GetEnumerator ()

Returns

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

Remarks

If the item count changes or items change index the enumeration may be invalidated.

Requirements

Namespace: Sansar.Utility
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0

System.Collections.IEnumerable.GetEnumerator Method

Returns an enumerator that iterates through the collection.

Syntax

IEnumerator System.Collections.IEnumerable.GetEnumerator ()

Returns

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

Remarks

If the item count changes or items change index the enumeration may be invalidated.

Requirements

Namespace: Sansar.Utility
Assembly: Sansar.Script (in Sansar.Script.dll)
Assembly Versions: 1.0.0.0


Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.