編集

CompositionScopeDefinition Class

Definition

Represents a node in a tree of scoped catalogs, reflecting an underlying catalog and its child scopes.

public ref class CompositionScopeDefinition : System::ComponentModel::Composition::Primitives::ComposablePartCatalog, System::ComponentModel::Composition::Hosting::INotifyComposablePartCatalogChanged
public class CompositionScopeDefinition : System.ComponentModel.Composition.Primitives.ComposablePartCatalog, System.ComponentModel.Composition.Hosting.INotifyComposablePartCatalogChanged
type CompositionScopeDefinition = class
    inherit ComposablePartCatalog
    interface INotifyComposablePartCatalogChanged
Public Class CompositionScopeDefinition
Inherits ComposablePartCatalog
Implements INotifyComposablePartCatalogChanged
Inheritance
CompositionScopeDefinition
Implements

Remarks

Important

This type implements the IDisposable interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its Dispose method in a try/catch block. To dispose of it indirectly, use a language construct such as using (in C#) or Using (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the IDisposable interface topic.

Constructors

Name Description
CompositionScopeDefinition()

Initializes a new instance of the CompositionScopeDefinition class.

CompositionScopeDefinition(ComposablePartCatalog, IEnumerable<CompositionScopeDefinition>, IEnumerable<ExportDefinition>)

Initializes a new instance of the CompositionScopeDefinition class with the specified underlying catalog, children, and public surface.

CompositionScopeDefinition(ComposablePartCatalog, IEnumerable<CompositionScopeDefinition>)

Initializes a new instance of the CompositionScopeDefinition class with the specified underlying catalog and children.

Properties

Name Description
Children

Gets the child scopes of this catalog.

Parts

Gets the part definitions that are contained in the catalog.

(Inherited from ComposablePartCatalog)
PublicSurface

Gets a collection of parts visible to the parent scope of this catalog.

Methods

Name Description
Dispose()

Releases all resources used by the ComposablePartCatalog.

(Inherited from ComposablePartCatalog)
Dispose(Boolean)

Called by the Dispose() and Finalize() methods to release the managed and unmanaged resources used by the current instance of the CompositionScopeDefinition class.

GetEnumerator()

Returns an enumerator that iterates through the catalog.

GetExports(ImportDefinition)

Gets a collection of exports that match the conditions specified by the import definition.

OnChanged(ComposablePartCatalogChangeEventArgs)

Raises the Changed event.

OnChanging(ComposablePartCatalogChangeEventArgs)

Raises the Changing event.

Events

Name Description
Changed

Occurs when the underlying catalog has changed, if that catalog supports notifications.

Changing

Occurs when the underlying catalog is changing, if that catalog supports notifications.

Explicit Interface Implementations

Name Description
IEnumerable.GetEnumerator()

Returns an enumerator that iterates through the catalog.

(Inherited from ComposablePartCatalog)

Extension Methods

Name Description
CreateCompositionService(ComposablePartCatalog)

Creates a new composition service by using the specified catalog as a source for exports.

Filter(ComposablePartCatalog, Func<ComposablePartDefinition,Boolean>)

Filters the specified catalog with the specified filter function.

ToAsyncEnumerable<TSource>(IEnumerable<TSource>)

Creates a new IAsyncEnumerable<T> that iterates through source.

ToFrozenDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

Creates a FrozenDictionary<TKey,TValue> from an IEnumerable<T> according to specified key selector and element selector functions.

ToFrozenDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Creates a FrozenDictionary<TKey,TValue> from an IEnumerable<T> according to specified key selector function.

ToFrozenSet<T>(IEnumerable<T>, IEqualityComparer<T>)

Creates a FrozenSet<T> with the specified values.

ToImmutableArray<TSource>(IEnumerable<TSource>)

Creates an immutable array from the specified collection.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)

Enumerates and transforms a sequence, and produces an immutable dictionary of its contents by using the specified key and value comparers.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>)

Enumerates and transforms a sequence, and produces an immutable dictionary of its contents by using the specified key comparer.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

Enumerates and transforms a sequence, and produces an immutable dictionary of its contents.

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Constructs an immutable dictionary based on some transformation of a sequence.

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

Constructs an immutable dictionary from an existing collection of elements, applying a transformation function to the source keys.

ToImmutableHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

Enumerates a sequence, produces an immutable hash set of its contents, and uses the specified equality comparer for the set type.

ToImmutableHashSet<TSource>(IEnumerable<TSource>)

Enumerates a sequence and produces an immutable hash set of its contents.

ToImmutableList<TSource>(IEnumerable<TSource>)

Enumerates a sequence and produces an immutable list of its contents.

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>, IEqualityComparer<TValue>)

Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents by using the specified key and value comparers.

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>)

Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents by using the specified key comparer.

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents.

ToImmutableSortedSet<TSource>(IEnumerable<TSource>, IComparer<TSource>)

Enumerates a sequence, produces an immutable sorted set of its contents, and uses the specified comparer.

ToImmutableSortedSet<TSource>(IEnumerable<TSource>)

Enumerates a sequence and produces an immutable sorted set of its contents.

Applies to