コード例 #1
0
ファイル: RuntimeImports.cs プロジェクト: petriw/Balder
        public RuntimeImports()
        {
            var packageCatalog = new PackageCatalog();
            packageCatalog.AddPackage(Package.Current);

            var container = new CompositionContainer(packageCatalog);
            container.ComposeParts(this);
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: ibratoev/MEF.NET35
 private void InitializeContainer()
 {
     var catalog = new AggregateCatalog();
     var packageCatalog = new PackageCatalog();
     catalog.Catalogs.Add(packageCatalog);
     packageCatalog.AddPackage(Package.Current);
     var container = new CompositionContainer(catalog);
     container.ComposeExportedValue(packageCatalog);
     CompositionHost.InitializeContainer(container);
 }
コード例 #3
0
ファイル: Composer.cs プロジェクト: petriw/Balder
        public Composer(IObjectFactory objectFactory)
        {
            _objectFactory = objectFactory;
            var packageCatalog = new PackageCatalog();

            packageCatalog.AddPackage(Package.Current);

            var provider = new Exporter(objectFactory);

            _compositionContainer = new Container(packageCatalog,objectFactory); //, provider);
        }
コード例 #4
0
ファイル: InteractiveTextBox.cs プロジェクト: JuRogn/OA
 public InteractiveTextBox()
     : base()
 {
     try
     {
         var catalog = new PackageCatalog();
         catalog.AddPackage(Package.Current);
         var container = new CompositionContainer(catalog);
         container.ComposeParts(this);
     }
     catch (Exception exc)
     {
         throw new Exception("The application is missing an IDefineCommand and/or IPerformCommand component. Make sure the application refers to projects that implement these. ", exc);
     }
 }