コード例 #1
0
 public ComponentModel(MEFv3.ExportProvider exportProvider)
 {
     this.ExportProvider = exportProvider;
 }
コード例 #2
0
    public async Task TestAssemblyIsInMefCatalog()
    {
        Microsoft.VisualStudio.Composition.ExportProvider ep = await this.mef.CreateExportProviderAsync();

        Assert.NotNull(ep.GetExportedValue <SomeMefExport>());
    }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DelegatingExportProvider"/> class.
 /// </summary>
 /// <param name="inner">The instance to forward queries to.</param>
 protected DelegatingExportProvider(ExportProvider inner)
     : base(inner.Resolver)
 {
     Requires.NotNull(inner, nameof(inner));
     this.inner = inner;
 }
コード例 #4
0
ファイル: NetFxAdapters.cs プロジェクト: sharwell/vs-mef
            internal MefV1ExportProvider(ExportProvider exportProvider)
            {
                Requires.NotNull(exportProvider, nameof(exportProvider));

                this.exportProvider = exportProvider;
            }
コード例 #5
0
ファイル: NetFxAdapters.cs プロジェクト: sharwell/vs-mef
 private CompositionService([MefV1.Import] ExportProvider exportProvider)
 {
     Requires.NotNull(exportProvider, nameof(exportProvider));
     this.container = new MefV1.Hosting.CompositionContainer(MefV1.Hosting.CompositionOptions.IsThreadSafe, exportProvider.AsExportProvider());
 }
コード例 #6
0
ファイル: NetFxAdapters.cs プロジェクト: sharwell/vs-mef
        /// <summary>
        /// Creates an instance of a <see cref="MefV1.Hosting.ExportProvider"/>
        /// for purposes of compatibility with the version of MEF found in the .NET Framework.
        /// </summary>
        /// <param name="exportProvider">The <see cref="Microsoft.VisualStudio.Composition.ExportProvider"/> to wrap.</param>
        /// <returns>A MEF "v1" shim.</returns>
        public static MefV1.Hosting.ExportProvider AsExportProvider(this ExportProvider exportProvider)
        {
            Requires.NotNull(exportProvider, nameof(exportProvider));

            return(new MefV1ExportProvider(exportProvider));
        }