Implement MachineKey.Protect and MachineKey.Unprotect
[mono.git] / mcs / class / System.ComponentModel.Composition / src / ComponentModel / System / ComponentModel / Composition / PartCreationPolicyAttribute.cs
1 // -----------------------------------------------------------------------\r
2 // Copyright (c) Microsoft Corporation.  All rights reserved.\r
3 // -----------------------------------------------------------------------\r
4 using System;\r
5 using System.ComponentModel.Composition.Primitives;\r
6 \r
7 namespace System.ComponentModel.Composition\r
8 {\r
9     /// <summary>\r
10     ///     Specifies <see cref="CreationPolicy"/> for a given <see cref="ComposablePart" />.\r
11     /// </summary>\r
12     [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]\r
13     public sealed class PartCreationPolicyAttribute : Attribute\r
14     {\r
15         internal static PartCreationPolicyAttribute Default = new PartCreationPolicyAttribute(CreationPolicy.Any);\r
16         internal static PartCreationPolicyAttribute Shared = new PartCreationPolicyAttribute(CreationPolicy.Shared);\r
17 \r
18         /// <summary>\r
19         ///     Initializes a new instance of the <see cref="PartCreationPolicyAttribute"/> class.\r
20         /// </summary>\r
21         public PartCreationPolicyAttribute(CreationPolicy creationPolicy)\r
22         {\r
23             this.CreationPolicy = creationPolicy;\r
24         }\r
25 \r
26         /// <summary>\r
27         ///     Gets or sets a value indicating the creation policy of the attributed part.\r
28         /// </summary>\r
29         /// <value>\r
30         ///     One of the <see cref="CreationPolicy"/> values indicating the creation policy of the \r
31         ///     attributed part. The default is \r
32         ///     <see cref="System.ComponentModel.Composition.CreationPolicy.Any"/>.\r
33         /// </value>\r
34         public CreationPolicy CreationPolicy { get; private set; }\r
35     }\r
36 }\r