Share via


VsEnumerable<TComEnumerator, TComEnumerated, TEnumerated>.CreateEnumerator Method

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.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)

Syntax

'Declaration
Protected MustOverride Function CreateEnumerator ( _
    collection As IEnumerable(Of TEnumerated), _
    enumeratorPosition As Integer _
) As TComEnumerator
protected abstract TComEnumerator CreateEnumerator(
    IEnumerable<TEnumerated> collection,
    int enumeratorPosition
)
protected:
virtual TComEnumerator CreateEnumerator(
    IEnumerable<TEnumerated>^ collection, 
    int enumeratorPosition
) abstract
abstract CreateEnumerator : 
        collection:IEnumerable<'TEnumerated> * 
        enumeratorPosition:int -> 'TComEnumerator 
protected abstract function CreateEnumerator(
    collection : IEnumerable<TEnumerated>, 
    enumeratorPosition : int
) : TComEnumerator

Parameters

  • collection
    Type: IEnumerable<TEnumerated>

    The collection to be enumerated.

  • enumeratorPosition
    Type: Int32

    The position of the created enumerator in the collection.

Return Value

Type: TComEnumerator
An instance of the derived class implementing the enumerator.

Remarks

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.

.NET Framework Security

See Also

Reference

VsEnumerable<TComEnumerator, TComEnumerated, TEnumerated> Class

Microsoft.VisualStudio.Shell Namespace