1 // -----------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // -----------------------------------------------------------------------
5 using System
.ComponentModel
.Composition
.Hosting
;
6 using System
.Diagnostics
.CodeAnalysis
;
8 namespace System
.ComponentModel
.Composition
11 /// Specifies that a type or interface that provides a particular export.
13 [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")]
14 [AttributeUsage(AttributeTargets
.Class
| AttributeTargets
.Interface
, AllowMultiple
= true, Inherited
= true)]
15 public class InheritedExportAttribute
: ExportAttribute
18 /// Initializes a new instance of the <see cref="ExportAttribute"/> class, exporting the
19 /// type marked with this attribute under the default contract name.
23 /// The default contract name is the result of calling
24 /// <see cref="AttributedModelServices.GetContractName(Type)"/> on the type itself,
25 /// that is marked with this attribute.
28 /// The contract name is compared using a case-sensitive, non-linguistic comparison
29 /// using <see cref="StringComparer.Ordinal"/>.
32 public InheritedExportAttribute()
33 : this((string)null, (Type
)null)
38 /// Initializes a new instance of the <see cref="ExportAttribute"/> class, exporting the
39 /// type marked with this attribute under a contract name derived from the specified type.
41 /// <param name="contractType">
42 /// A <see cref="Type"/> of which to derive the contract name to export the type
43 /// marked with this attribute, under; or <see langword="null"/> to use the
44 /// default contract name.
48 /// The contract name is the result of calling
49 /// <see cref="AttributedModelServices.GetContractName(Type)"/> on
50 /// <paramref name="contractType"/>.
53 /// The default contract name is the result of calling
54 /// <see cref="AttributedModelServices.GetContractName(Type)"/> on the type of the
55 /// itself, that is marked with this attribute.
58 /// The contract name is compared using a case-sensitive, non-linguistic comparison
59 /// using <see cref="StringComparer.Ordinal"/>.
62 public InheritedExportAttribute(Type contractType
)
63 : this((string)null, contractType
)
68 /// Initializes a new instance of the <see cref="ExportAttribute"/> class, exporting the
69 /// type or member marked with this attribute under the specified contract name.
71 /// <param name="contractName">
72 /// A <see cref="String"/> containing the contract name to export the type
73 /// marked with this attribute, under; or <see langword="null"/> or an empty string
74 /// ("") to use the default contract name.
78 /// The default contract name is the result of calling
79 /// <see cref="AttributedModelServices.GetContractName(Type)"/> on
80 /// the type itself that this is marked with this attribute.
83 /// The contract name is compared using a case-sensitive, non-linguistic comparison
84 /// using <see cref="StringComparer.Ordinal"/>.
87 public InheritedExportAttribute(string contractName
)
88 : this(contractName
, (Type
)null)
93 /// Initializes a new instance of the <see cref="ExportAttribute"/> class, exporting the
94 /// type or member marked with this attribute under the specified contract name.
96 /// <param name="contractName">
97 /// A <see cref="String"/> containing the contract name to export the type
98 /// marked with this attribute, under; or <see langword="null"/> or an empty string
99 /// ("") to use the default contract name.
101 /// <param name="contractType">
102 /// A <see cref="Type"/> of which to derive the contract name to export the type
103 /// marked with this attribute, under; or <see langword="null"/> to use the
104 /// default contract name.
108 /// The default contract name is the result of calling
109 /// <see cref="AttributedModelServices.GetContractName(Type)"/> on
110 /// the type itself that this is marked with this attribute.
113 /// The contract name is compared using a case-sensitive, non-linguistic comparison
114 /// using <see cref="StringComparer.Ordinal"/>.
117 public InheritedExportAttribute(string contractName
, Type contractType
)
118 : base(contractName
, contractType
)