EnumerableComCollection<TComEnumerator,TEnumerated> EnumerableComCollection<TComEnumerator,TEnumerated> EnumerableComCollection<TComEnumerator,TEnumerated> EnumerableComCollection<TComEnumerator,TEnumerated> Class

Definition

Provides a generic base class for types that provide an IEnumerable wrapper around COM-style IEnumXXX interfaces.

generic <typename TComEnumerator, typename TEnumerated>
public ref class EnumerableComCollection abstract : Microsoft::VisualStudio::Shell::IComEnumeratorRelay<TComEnumerator, TEnumerated>, System::Collections::Generic::IEnumerable<TEnumerated>
public abstract class EnumerableComCollection<TComEnumerator,TEnumerated> : Microsoft.VisualStudio.Shell.IComEnumeratorRelay<TComEnumerator,TEnumerated>, System.Collections.Generic.IEnumerable<TEnumerated>
type EnumerableComCollection<'ComEnumerator, 'Enumerated> = class
    interface seq<'Enumerated>
    interface IEnumerable
    interface IComEnumeratorRelay<'ComEnumerator, 'Enumerated>
Public MustInherit Class EnumerableComCollection(Of TComEnumerator, TEnumerated)
Implements IComEnumeratorRelay(Of TComEnumerator, TEnumerated), IEnumerable(Of TEnumerated)
Type Parameters
TComEnumerator

The type of the enumerator.

TEnumerated

A COM enumerator type (e.g. IEnumString).

Inheritance
EnumerableComCollection<TComEnumerator,TEnumerated>EnumerableComCollection<TComEnumerator,TEnumerated>EnumerableComCollection<TComEnumerator,TEnumerated>EnumerableComCollection<TComEnumerator,TEnumerated>
Derived
Implements

Remarks

Classes that derive from this class adapt a COM-style IEnumXXX interface

into an form that can be processed by a foreach statement. Ideally this

generic class would be sufficient on its own without the need for a derived

class to do the job, but the rigor with which C# generics must be defined

prevents that.

This class must call methods on the COM enumerator that it wraps (Next,

Skip, etc.), but generic types can only access properties and methods on

their parameterized types that are specified in the parameterized types'

constraints. Specifically, we can only call TComEnumerator.Next if we

specify a constraint on TComEnumerator that tells the compiler that

TComEnumerator implements Next.

COM IEnumXXX interfaces are strongly typed (i.e. IEnumXXX.Next returns an

array of XXX objects) and do not have a common base class, so we can't

place a constraint on TComEnumerator directly. This is where IComEnumeratorRelay

comes in: EnumerableComCollection requires that its derived class implements the

strongly-typed IComEnumeratorRelay interface which allows the generic type

to call into the COM enumerator without having to place a constraint on

TComEnumerator.

Constructors

EnumerableComCollection<TComEnumerator,TEnumerated>(TComEnumerator) EnumerableComCollection<TComEnumerator,TEnumerated>(TComEnumerator) EnumerableComCollection<TComEnumerator,TEnumerated>(TComEnumerator) EnumerableComCollection<TComEnumerator,TEnumerated>(TComEnumerator)

Initializes a new instance of EnumerableComCollection<TComEnumerator,TEnumerated> for the provided enumerator.

EnumerableComCollection<TComEnumerator,TEnumerated>(TComEnumerator, Int32) EnumerableComCollection<TComEnumerator,TEnumerated>(TComEnumerator, Int32) EnumerableComCollection<TComEnumerator,TEnumerated>(TComEnumerator, Int32) EnumerableComCollection<TComEnumerator,TEnumerated>(TComEnumerator, Int32)

Initializes a new instance of EnumerableComCollection<TComEnumerator,TEnumerated> for the provided enumerator and cache size.

Fields

DefaultCacheSize DefaultCacheSize DefaultCacheSize DefaultCacheSize

The default cache size.

Methods

Clone(TComEnumerator, TComEnumerator) Clone(TComEnumerator, TComEnumerator) Clone(TComEnumerator, TComEnumerator) Clone(TComEnumerator, TComEnumerator)

Clones the item with the specified enumerator .

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Gets the enumerator.

NextItems(TComEnumerator, UInt32, TEnumerated[], UInt32) NextItems(TComEnumerator, UInt32, TEnumerated[], UInt32) NextItems(TComEnumerator, UInt32, TEnumerated[], UInt32) NextItems(TComEnumerator, UInt32, TEnumerated[], UInt32)

Gets the specified number of items.

Reset(TComEnumerator) Reset(TComEnumerator) Reset(TComEnumerator) Reset(TComEnumerator)

Resets the counter of the collection.

Skip(TComEnumerator, UInt32) Skip(TComEnumerator, UInt32) Skip(TComEnumerator, UInt32) Skip(TComEnumerator, UInt32)

Skips the specified number of items.

Explicit Interface Implementations

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

Gets the enumerator.

Extension Methods

FindAncestor<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestor<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestor<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestor<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>)
FindAncestor<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestor<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestor<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestor<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>)

Microsoft internal use only.

FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>) FindAncestorOrSelf<TElementType>(TElementType, Func<TElementType,TElementType>, Func<TElementType,Boolean>)
FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>) FindAncestorOrSelf<TAncestorType,TElementType>(TElementType, Func<TElementType,TElementType>)
IsAncestorOf<TElementType>(TElementType, TElementType, Func<TElementType,TElementType>) IsAncestorOf<TElementType>(TElementType, TElementType, Func<TElementType,TElementType>) IsAncestorOf<TElementType>(TElementType, TElementType, Func<TElementType,TElementType>) IsAncestorOf<TElementType>(TElementType, TElementType, Func<TElementType,TElementType>)

Microsoft internal use only.

Applies to