1
// -----------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // -----------------------------------------------------------------------
5 using System
.ComponentModel
.Composition
.Primitives
;
7 namespace System
.ComponentModel
.Composition
10 /// Specifies metadata for a type to be used as a <see cref="ComposablePartDefinition"/> and
11 /// <see cref="ComposablePart"/>.
13 [AttributeUsage(AttributeTargets
.Class
, AllowMultiple
= true, Inherited
= false)]
14 public sealed class PartMetadataAttribute
: Attribute
17 /// Initializes a new instance of the <see cref="PartMetadataAttribute"/> with the
18 /// specified name and metadata value.
20 /// <param name="name">
21 /// A <see cref="String"/> containing the name of the metadata value; or
22 /// <see langword="null"/> to use an empty string ("").
24 /// <param name="value">
25 /// An <see cref="object"/> containing the metadata value. This can be
26 /// <see langword="null"/>.
28 public PartMetadataAttribute(string name
, object value)
30 this.Name
= name
?? string.Empty
;
35 /// Gets the name of the metadata value.
38 /// A <see cref="String"/> containing the name of the metadata value.
47 /// Gets the metadata value.
50 /// An <see cref="object"/> containing the metadata value.