2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / class / System.ComponentModel.Composition / src / ComponentModel / System / ComponentModel / Composition / PartMetadataAttribute.cs
bloba700a293c1b969243c31b20685f2d1225c8b45df
1 // -----------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // -----------------------------------------------------------------------
4 using System;
5 using System.ComponentModel.Composition.Primitives;
7 namespace System.ComponentModel.Composition
9 /// <summary>
10 /// Specifies metadata for a type to be used as a <see cref="ComposablePartDefinition"/> and
11 /// <see cref="ComposablePart"/>.
12 /// </summary>
13 [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
14 public sealed class PartMetadataAttribute : Attribute
16 /// <summary>
17 /// Initializes a new instance of the <see cref="PartMetadataAttribute"/> with the
18 /// specified name and metadata value.
19 /// </summary>
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 ("").
23 /// </param>
24 /// <param name="value">
25 /// An <see cref="object"/> containing the metadata value. This can be
26 /// <see langword="null"/>.
27 /// </param>
28 public PartMetadataAttribute(string name, object value)
30 this.Name = name ?? string.Empty;
31 this.Value = value;
34 /// <summary>
35 /// Gets the name of the metadata value.
36 /// </summary>
37 /// <value>
38 /// A <see cref="String"/> containing the name of the metadata value.
39 /// </value>
40 public string Name
42 get;
43 private set;
46 /// <summary>
47 /// Gets the metadata value.
48 /// </summary>
49 /// <value>
50 /// An <see cref="object"/> containing the metadata value.
51 /// </value>
52 public object Value
54 get;
55 private set;