1 // -----------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // -----------------------------------------------------------------------
5 using System
.ComponentModel
.Composition
.Hosting
;
6 using System
.ComponentModel
.Composition
.Primitives
;
8 namespace System
.ComponentModel
.Composition
11 /// Option placed on a type that controls when the <see cref="CompositionContainer"/> creates
12 /// a new instance of a <see cref="ComposablePart"/>.
14 public enum CreationPolicy
: int
17 /// Let the <see cref="CompositionContainer"/> choose the most appropriate <see cref="CreationPolicy"/>
18 /// for the part given the current context. This is the default <see cref="CreationPolicy"/>, with
19 /// the <see cref="CompositionContainer"/> choosing <see cref="CreationPolicy.Shared"/> by default
20 /// unless the <see cref="ComposablePart"/> or importer requests <see cref="CreationPolicy.NonShared"/>.
25 /// A single shared instance of the associated <see cref="ComposablePart"/> will be created
26 /// by the <see cref="CompositionContainer"/> and shared by all requestors.
31 /// A new non-shared instance of the associated <see cref="ComposablePart"/> will be created
32 /// by the <see cref="CompositionContainer"/> for every requestor.