2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / class / System.ComponentModel.Composition / src / ComponentModel / System / ComponentModel / Composition / CreationPolicy.cs
blob5a8d4cb158b1a9eebd81a3bc5f083a68a07c244c
1 // -----------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // -----------------------------------------------------------------------
4 using System;
5 using System.ComponentModel.Composition.Hosting;
6 using System.ComponentModel.Composition.Primitives;
8 namespace System.ComponentModel.Composition
10 /// <summary>
11 /// Option placed on a type that controls when the <see cref="CompositionContainer"/> creates
12 /// a new instance of a <see cref="ComposablePart"/>.
13 /// </summary>
14 public enum CreationPolicy : int
16 /// <summary>
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"/>.
21 /// </summary>
22 Any = 0,
24 /// <summary>
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.
27 /// </summary>
28 Shared = 1,
30 /// <summary>
31 /// A new non-shared instance of the associated <see cref="ComposablePart"/> will be created
32 /// by the <see cref="CompositionContainer"/> for every requestor.
33 /// </summary>
34 NonShared = 2,