VsEnumerable<TComEnumerator, TComEnumerated, TEnumerated>::CreateEnumerator Method (IEnumerable<TEnumerated>^, Int32)

 

Creates a new instance of derived class that is the COM-enumerator over the enumerated collection, starting from the specified enumerator position.

Namespace:   Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)

protected:
virtual TComEnumerator CreateEnumerator(
	IEnumerable<TEnumerated>^ collection,
	int enumeratorPosition
) abstract

Parameters

collection
Type: System.Collections.Generic::IEnumerable<TEnumerated>^

The collection to be enumerated.

enumeratorPosition
Type: System::Int32

The position of the created enumerator in the collection.

Return Value

Type: TComEnumerator

An instance of the derived class implementing the enumerator.

Derived classes need to implement the following pattern:

  • Create a private constructor with similar parameters as this function, calling the protected constructor in this base class with the same signature (collection and enumeratorPosition).

    Override the CreateEnumerator method and call the derived class' constructor with the two parameters.

Return to top
Show: