public RuntimeImports() { var packageCatalog = new PackageCatalog(); packageCatalog.AddPackage(Package.Current); var container = new CompositionContainer(packageCatalog); container.ComposeParts(this); }
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); }
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); }
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); } }