/
MetadataViewImplementationAttribute.cs
41 lines (39 loc) · 1.82 KB
/
MetadataViewImplementationAttribute.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.ComponentModel.Composition
{
/// <summary>
/// Specifies that a type, property, field, or method provides a particular export.
/// </summary>
[AttributeUsage(AttributeTargets.Interface, AllowMultiple = false, Inherited = false)]
public sealed class MetadataViewImplementationAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="MetadataViewImplementationAttribute"/> class, declaring the
/// type that holds the implementation for the view.
/// </summary>
/// <param name="implementationType">
/// A <see cref="Type"/> for the implementation of the MetadataView.
/// </param>
/// <remarks>
/// <para>
/// By default MetadataViews are generated using reflection emit. This attribute
/// allows the developer to specify the ttype that implements the view rather than
/// using a generated type.
/// </para>
/// </remarks>
public MetadataViewImplementationAttribute(Type? implementationType)
{
ImplementationType = implementationType;
}
/// <summary>
/// Get the type that is used to implement the view to which this attribute is attached.
/// </summary>
/// <value>
/// A <see cref="Type"/> of the export that is be provided. The default value is
/// <see langword="null"/> which means that the type will be obtained by looking at the type on
/// the member that this export is attached to.
/// </value>
public Type? ImplementationType { get; private set; }
}
}