Ejemplo n.º 1
0
 public Report()
 {
     fw = new ComposablePartExportProvider().GetExport <FXCoreWrapper>().Value;
     //App.container.SatisfyImportsOnce(this);
     InitializeComponent();
     fw.CoreFX.LoginError += CoreFX_LoginError;
 }
Ejemplo n.º 2
0
        public CompositionScopingService(ComposablePartCatalog allParts, Action <CompositionBatch> explicitExports, IEnumerable <string> possibleScopes)
        {
            //Contract.Requires( allParts != null );
            //Contract.Requires( explicitExports != null );
            //Contract.Requires( possibleScopes != null );
            //Contract.Requires( possibleScopes.Any() );

            var rootCatalog = allParts.OutOfScope(possibleScopes);

            _explicitExports = new ComposablePartExportProvider();
            _rootContainer   = new CompositionContainer(rootCatalog, CompositionOptions.DisableSilentRejection, _explicitExports);
            _explicitExports.SourceProvider = _rootContainer;

            var b = new CompositionBatch();

            explicitExports(b);
            b.AddExportedValue(RootScope);
            b.AddExportedValue(this as ICompositionScopingService);
            _explicitExports.Compose(b);

            _scopeCatalogs = possibleScopes.ToDictionary(s => s, s => allParts.Scope(s));
        }