-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
ExportDescriptor.cs
36 lines (32 loc) · 1.43 KB
/
ExportDescriptor.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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
namespace System.Composition.Hosting.Core
{
/// <summary>
/// Describes an export of a part known to the composition engine. This is the only runtime
/// overhead that is maintained per-part; all other part-specific information must be discarded once
/// its export descriptors have been retrieved.
/// </summary>
public abstract class ExportDescriptor
{
/// <summary>
/// The activator used to retrieve instances of the export.
/// </summary>
public abstract CompositeActivator Activator { get; }
/// <summary>
/// The Export Metadata associated with the export.
/// </summary>
public abstract IDictionary<string, object> Metadata { get; }
/// <summary>
/// Construct an <see cref="ExportDescriptor"/>.
/// </summary>
/// <param name="activator">The activator used to retrieve instances of the export.</param>
/// <param name="metadata">The Export Metadata associated with the export.</param>
/// <returns>The export descriptor.</returns>
public static ExportDescriptor Create(CompositeActivator activator, IDictionary<string, object> metadata)
{
return new DirectExportDescriptor(activator, metadata);
}
}
}