Modifier

Partager via


CollectionsExtensions.DisposeElements Method

Definition

Overloads

DisposeElements<TElement>(IEnumerable<TElement>)

Disposes of all non-null elements in a collection.

DisposeElements<TElement>(IList<TElement>)

Disposes of all non-null elements in a collection.

DisposeElements<TElement>(IEnumerable<TElement>)

Disposes of all non-null elements in a collection.

public:
generic <typename TElement>
 where TElement : IDisposable[System::Runtime::CompilerServices::Extension]
 static void DisposeElements(System::Collections::Generic::IEnumerable<TElement> ^ elements);
public static void DisposeElements<TElement> (this System.Collections.Generic.IEnumerable<TElement> elements) where TElement : IDisposable;
static member DisposeElements : seq<'Element (requires 'Element :> IDisposable)> -> unit (requires 'Element :> IDisposable)
<Extension()>
Public Sub DisposeElements(Of TElement As IDisposable) (elements As IEnumerable(Of TElement))

Type Parameters

TElement

The type of element in the collection.

Parameters

elements
IEnumerable<TElement>

The collection of elements to be disposed.

Applies to

DisposeElements<TElement>(IList<TElement>)

Disposes of all non-null elements in a collection.

public:
generic <typename TElement>
 where TElement : IDisposable[System::Runtime::CompilerServices::Extension]
 static void DisposeElements(System::Collections::Generic::IList<TElement> ^ elements);
public static void DisposeElements<TElement> (this System.Collections.Generic.IList<TElement> elements) where TElement : IDisposable;
static member DisposeElements : System.Collections.Generic.IList<'Element (requires 'Element :> IDisposable)> -> unit (requires 'Element :> IDisposable)
<Extension()>
Public Sub DisposeElements(Of TElement As IDisposable) (elements As IList(Of TElement))

Type Parameters

TElement

The type of element in the collection.

Parameters

elements
IList<TElement>

The collection of elements to be disposed.

Applies to