ScriptStack 1.0.4
Loading...
Searching...
No Matches
ScriptStack.Collections.ReadOnlyICollection< T > Class Template Reference
Inheritance diagram for ScriptStack.Collections.ReadOnlyICollection< T >:

Public Member Functions

 ReadOnlyICollection (ICollection< T > collectionToWrap)
 Initializes a new instance of the ReadOnlyICollection<T> class.
void Add (T item)
 Add does not change a ReadOnlyICollection.
bool Remove (T item)
 Remove does not change a ReadOnlyICollection.

Static Public Member Functions

static ReadOnlyICollection< T > AsReadOnly (ICollection< T > collectionToWrap)
 Returned a read only wrapper around the collectionToWrap.

Properties

bool IsReadOnly [get]
 Clear does not change a ReadOnlyICollection.
int Count [get]
 Returns an enumerator that iterates through the collection.

Detailed Description

Definition at line 10 of file ReadOnlyICollection.cs.

Member Function Documentation

◆ Add()

void ScriptStack.Collections.ReadOnlyICollection< T >.Add ( T item)

Add does not change a ReadOnlyICollection.

Parameters
itemThe object to add to the T:System.Collections.Generic.ICollection`1.
Exceptions
T:System.NotSupportedExceptionThe T:System.Collections.Generic.ICollection`1 is read-only.

Definition at line 63 of file ReadOnlyICollection.cs.

64 {
65 }

◆ AsReadOnly()

ReadOnlyICollection< T > ScriptStack.Collections.ReadOnlyICollection< T >.AsReadOnly ( ICollection< T > collectionToWrap)
static

Returned a read only wrapper around the collectionToWrap.

Parameters
collectionToWrapThe collection to wrap.
Returns

Definition at line 40 of file ReadOnlyICollection.cs.

41 {
42 return new ReadOnlyICollection<T>(collectionToWrap);
43 }

References ReadOnlyICollection().

◆ ReadOnlyICollection()

ScriptStack.Collections.ReadOnlyICollection< T >.ReadOnlyICollection ( ICollection< T > collectionToWrap)

Initializes a new instance of the ReadOnlyICollection<T> class.

Parameters
collectionToWrapThe collection to wrap.

Definition at line 53 of file ReadOnlyICollection.cs.

54 {
55 m_collection = collectionToWrap;
56 }

Referenced by AsReadOnly().

◆ Remove()

bool ScriptStack.Collections.ReadOnlyICollection< T >.Remove ( T item)

Remove does not change a ReadOnlyICollection.

Parameters
itemThe object to remove from the T:System.Collections.Generic.ICollection`1.
Returns
true if item was successfully removed from the T:System.Collections.Generic.ICollection`1; otherwise, false. This method also returns false if item is not found in the original T:System.Collections.Generic.ICollection`1.
Exceptions
T:System.NotSupportedExceptionThe T:System.Collections.Generic.ICollection`1 is read-only.

Definition at line 121 of file ReadOnlyICollection.cs.

122 {
123 return false;
124 }

Property Documentation

◆ Count

int ScriptStack.Collections.ReadOnlyICollection< T >.Count
get

Returns an enumerator that iterates through the collection.

Returns
A T:System.Collections.Generic.IEnumerator`1 that can be used to iterate through the collection.

*/ public IEnumerator<T> GetEnumerator() { return m_collection.GetEnumerator(); }

/**

Gets the number of elements contained in the T:System.Collections.Generic.ICollection`1.

Returns
The number of elements contained in the T:System.Collections.Generic.ICollection`1.

Definition at line 146 of file ReadOnlyICollection.cs.

147 {
148 get
149 {
150 return m_collection.Count;
151 }
152 }

◆ IsReadOnly

bool ScriptStack.Collections.ReadOnlyICollection< T >.IsReadOnly
get

Clear does not change a ReadOnlyICollection.

Exceptions
T:System.NotSupportedExceptionThe T:System.Collections.Generic.ICollection`1 is read-only.

*/ public void Clear() { }

/**

Determines whether the T:System.Collections.Generic.ICollection`1 contains a specific value.

Parameters
itemThe object to locate in the T:System.Collections.Generic.ICollection`1.
Returns
true if item is found in the T:System.Collections.Generic.ICollection`1; otherwise, false.

*/ public bool Contains(T item) { return m_collection.Contains(item); }

/**

Copies the elements of the T:System.Collections.Generic.ICollection`1 to an T:System.Array, starting at a particular T:System.Array index.

Parameters
arrayThe one-dimensional T:System.Array that is the destination of the elements copied from T:System.Collections.Generic.ICollection`1. The T:System.Array must have zero-based indexing.
arrayIndexThe zero-based index in array at which copying begins.
Exceptions
T:System.ArgumentOutOfRangeExceptionarrayIndex is less than 0.
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentExceptionarray is multidimensional.-or-arrayIndex is equal to or greater than the length of array.-or-The number of elements in the source T:System.Collections.Generic.ICollection`1 is greater than the available space from arrayIndex to the end of the destination array.-or-Type T cannot be cast automatically to the type of the destination array.

*/ public void CopyTo(T[] array, int arrayIndex) { m_collection.CopyTo(array, arrayIndex); }

/**

Gets a value indicating whether the T:System.Collections.Generic.ICollection`1 is read-only.

Returns
true if the T:System.Collections.Generic.ICollection`1 is read-only; otherwise, false.

Definition at line 105 of file ReadOnlyICollection.cs.

106 {
107 get
108 {
109 return true;
110 }
111 }

The documentation for this class was generated from the following file: