mscorlib(4.0.0.0) API with additions
System.Collections.CollectionBase Class Reference

Provides the abstract base class for a strongly typed collection. More...

Inheritance diagram for System.Collections.CollectionBase:
[legend]
Collaboration diagram for System.Collections.CollectionBase:
[legend]

Public Member Functions

void Clear ()
 Removes all objects from the T:System.Collections.CollectionBase instance. This method cannot be overridden. More...
 
void RemoveAt (int index)
 Removes the element at the specified index of the T:System.Collections.CollectionBase instance. This method is not overridable. More...
 
IEnumerator GetEnumerator ()
 Returns an enumerator that iterates through the T:System.Collections.CollectionBase instance. More...
 

Protected Member Functions

 CollectionBase ()
 Initializes a new instance of the T:System.Collections.CollectionBase class with the default initial capacity. More...
 
 CollectionBase (int capacity)
 Initializes a new instance of the T:System.Collections.CollectionBase class with the specified capacity. More...
 
virtual void OnSet (int index, object oldValue, object newValue)
 Performs additional custom processes before setting a value in the T:System.Collections.CollectionBase instance. More...
 
virtual void OnInsert (int index, object value)
 Performs additional custom processes before inserting a new element into the T:System.Collections.CollectionBase instance. More...
 
virtual void OnClear ()
 Performs additional custom processes when clearing the contents of the T:System.Collections.CollectionBase instance. More...
 
virtual void OnRemove (int index, object value)
 Performs additional custom processes when removing an element from the T:System.Collections.CollectionBase instance. More...
 
virtual void OnValidate (object value)
 Performs additional custom processes when validating a value. More...
 
virtual void OnSetComplete (int index, object oldValue, object newValue)
 Performs additional custom processes after setting a value in the T:System.Collections.CollectionBase instance. More...
 
virtual void OnInsertComplete (int index, object value)
 Performs additional custom processes after inserting a new element into the T:System.Collections.CollectionBase instance. More...
 
virtual void OnClearComplete ()
 Performs additional custom processes after clearing the contents of the T:System.Collections.CollectionBase instance. More...
 
virtual void OnRemoveComplete (int index, object value)
 Performs additional custom processes after removing an element from the T:System.Collections.CollectionBase instance. More...
 

Protected Attributes

IList List => this
 Gets an T:System.Collections.IList containing the list of elements in the T:System.Collections.CollectionBase instance. More...
 

Properties

ArrayList InnerList [get]
 Gets an T:System.Collections.ArrayList containing the list of elements in the T:System.Collections.CollectionBase instance. More...
 
int Capacity [get, set]
 Gets or sets the number of elements that the T:System.Collections.CollectionBase can contain. More...
 
int Count [get]
 Gets the number of elements contained in the T:System.Collections.CollectionBase instance. This property cannot be overridden. More...
 
- Properties inherited from System.Collections.IList
object this[int index] [get, set]
 Gets or sets the element at the specified index. More...
 
bool IsReadOnly [get]
 Gets a value indicating whether the T:System.Collections.IList is read-only. More...
 
bool IsFixedSize [get]
 Gets a value indicating whether the T:System.Collections.IList has a fixed size. More...
 
- Properties inherited from System.Collections.ICollection
int Count [get]
 Gets the number of elements contained in the T:System.Collections.ICollection. More...
 
object SyncRoot [get]
 Gets an object that can be used to synchronize access to the T:System.Collections.ICollection. More...
 
bool IsSynchronized [get]
 Gets a value indicating whether access to the T:System.Collections.ICollection is synchronized (thread safe). More...
 

Detailed Description

Provides the abstract base class for a strongly typed collection.

Definition at line 9 of file CollectionBase.cs.

Constructor & Destructor Documentation

◆ CollectionBase() [1/2]

System.Collections.CollectionBase.CollectionBase ( )
protected

Initializes a new instance of the T:System.Collections.CollectionBase class with the default initial capacity.

Definition at line 146 of file CollectionBase.cs.

◆ CollectionBase() [2/2]

System.Collections.CollectionBase.CollectionBase ( int  capacity)
protected

Initializes a new instance of the T:System.Collections.CollectionBase class with the specified capacity.

Parameters
capacityThe number of elements that the new list can initially store.

Definition at line 153 of file CollectionBase.cs.

Member Function Documentation

◆ Clear()

void System.Collections.CollectionBase.Clear ( )

Removes all objects from the T:System.Collections.CollectionBase instance. This method cannot be overridden.

Implements System.Collections.IList.

Definition at line 160 of file CollectionBase.cs.

◆ GetEnumerator()

IEnumerator System.Collections.CollectionBase.GetEnumerator ( )

Returns an enumerator that iterates through the T:System.Collections.CollectionBase instance.

Returns
An T:System.Collections.IEnumerator for the T:System.Collections.CollectionBase instance.

Implements System.Collections.IEnumerable.

Definition at line 302 of file CollectionBase.cs.

◆ OnClear()

virtual void System.Collections.CollectionBase.OnClear ( )
protectedvirtual

Performs additional custom processes when clearing the contents of the T:System.Collections.CollectionBase instance.

Reimplemented in System.Xml.Serialization.XmlSchemas, System.ComponentModel.Design.DesignerVerbCollection, System.Xml.Schema.XmlSchemaObjectCollection, System.Diagnostics.EventLogPermissionEntryCollection, and System.Diagnostics.PerformanceCounterPermissionEntryCollection.

Definition at line 323 of file CollectionBase.cs.

◆ OnClearComplete()

virtual void System.Collections.CollectionBase.OnClearComplete ( )
protectedvirtual

Performs additional custom processes after clearing the contents of the T:System.Collections.CollectionBase instance.

Definition at line 362 of file CollectionBase.cs.

◆ OnInsert()

virtual void System.Collections.CollectionBase.OnInsert ( int  index,
object  value 
)
protectedvirtual

Performs additional custom processes before inserting a new element into the T:System.Collections.CollectionBase instance.

Parameters
indexThe zero-based index at which to insert value .
valueThe new value of the element at index .

Reimplemented in System.Xml.Serialization.XmlSchemas, System.ComponentModel.Design.DesignerVerbCollection, System.Diagnostics.EventLogPermissionEntryCollection, System.Diagnostics.PerformanceCounterPermissionEntryCollection, and System.Xml.Schema.XmlSchemaObjectCollection.

Definition at line 318 of file CollectionBase.cs.

◆ OnInsertComplete()

virtual void System.Collections.CollectionBase.OnInsertComplete ( int  index,
object  value 
)
protectedvirtual

Performs additional custom processes after inserting a new element into the T:System.Collections.CollectionBase instance.

Parameters
indexThe zero-based index at which to insert value .
valueThe new value of the element at index .

Definition at line 357 of file CollectionBase.cs.

◆ OnRemove()

virtual void System.Collections.CollectionBase.OnRemove ( int  index,
object  value 
)
protectedvirtual

Performs additional custom processes when removing an element from the T:System.Collections.CollectionBase instance.

Parameters
indexThe zero-based index at which value can be found.
valueThe value of the element to remove from index .

Reimplemented in System.Xml.Serialization.XmlSchemas, System.ComponentModel.Design.DesignerVerbCollection, System.Xml.Schema.XmlSchemaObjectCollection, System.Diagnostics.EventLogPermissionEntryCollection, and System.Diagnostics.PerformanceCounterPermissionEntryCollection.

Definition at line 330 of file CollectionBase.cs.

◆ OnRemoveComplete()

virtual void System.Collections.CollectionBase.OnRemoveComplete ( int  index,
object  value 
)
protectedvirtual

Performs additional custom processes after removing an element from the T:System.Collections.CollectionBase instance.

Parameters
indexThe zero-based index at which value can be found.
valueThe value of the element to remove from index .

Definition at line 369 of file CollectionBase.cs.

◆ OnSet()

virtual void System.Collections.CollectionBase.OnSet ( int  index,
object  oldValue,
object  newValue 
)
protectedvirtual

Performs additional custom processes before setting a value in the T:System.Collections.CollectionBase instance.

Parameters
indexThe zero-based index at which oldValue can be found.
oldValueThe value to replace with newValue .
newValueThe new value of the element at index .

Reimplemented in System.Xml.Serialization.XmlSchemas, System.Diagnostics.EventLogPermissionEntryCollection, System.Diagnostics.PerformanceCounterPermissionEntryCollection, System.ComponentModel.Design.DesignerVerbCollection, and System.Xml.Schema.XmlSchemaObjectCollection.

Definition at line 311 of file CollectionBase.cs.

◆ OnSetComplete()

virtual void System.Collections.CollectionBase.OnSetComplete ( int  index,
object  oldValue,
object  newValue 
)
protectedvirtual

Performs additional custom processes after setting a value in the T:System.Collections.CollectionBase instance.

Parameters
indexThe zero-based index at which oldValue can be found.
oldValueThe value to replace with newValue .
newValueThe new value of the element at index .

Definition at line 350 of file CollectionBase.cs.

◆ OnValidate()

virtual void System.Collections.CollectionBase.OnValidate ( object  value)
protectedvirtual

Performs additional custom processes when validating a value.

Parameters
valueThe object to validate.
Exceptions
T:System.ArgumentNullExceptionvalue is null.

Reimplemented in System.Diagnostics.CounterCreationDataCollection, and System.ComponentModel.Design.DesignerVerbCollection.

Definition at line 338 of file CollectionBase.cs.

◆ RemoveAt()

void System.Collections.CollectionBase.RemoveAt ( int  index)

Removes the element at the specified index of the T:System.Collections.CollectionBase instance. This method is not overridable.

Parameters
indexThe zero-based index of the element to remove.
Exceptions
T:System.ArgumentOutOfRangeExceptionindex is less than zero.-or- index is equal to or greater than P:System.Collections.CollectionBase.Count.

Implements System.Collections.IList.

Definition at line 173 of file CollectionBase.cs.

Member Data Documentation

◆ List

IList System.Collections.CollectionBase.List => this
protected

Gets an T:System.Collections.IList containing the list of elements in the T:System.Collections.CollectionBase instance.

Returns
An T:System.Collections.IList representing the T:System.Collections.CollectionBase instance itself.

Definition at line 29 of file CollectionBase.cs.

Property Documentation

◆ Capacity

int System.Collections.CollectionBase.Capacity
getset

Gets or sets the number of elements that the T:System.Collections.CollectionBase can contain.

Returns
The number of elements that the T:System.Collections.CollectionBase can contain.
Exceptions
T:System.ArgumentOutOfRangeExceptionP:System.Collections.CollectionBase.Capacity is set to a value that is less than P:System.Collections.CollectionBase.Count.
T:System.OutOfMemoryExceptionThere is not enough memory available on the system.

Definition at line 38 of file CollectionBase.cs.

◆ Count

int System.Collections.CollectionBase.Count
get

Gets the number of elements contained in the T:System.Collections.CollectionBase instance. This property cannot be overridden.

Returns
The number of elements contained in the T:System.Collections.CollectionBase instance.Retrieving the value of this property is an O(1) operation.

Definition at line 52 of file CollectionBase.cs.

◆ InnerList

ArrayList System.Collections.CollectionBase.InnerList
getprotected

Gets an T:System.Collections.ArrayList containing the list of elements in the T:System.Collections.CollectionBase instance.

Returns
An T:System.Collections.ArrayList representing the T:System.Collections.CollectionBase instance itself.Retrieving the value of this property is an O(1) operation.

Definition at line 16 of file CollectionBase.cs.


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