public CatalogExportProvider(ComposablePartCatalog catalog, CompositionOptions compositionOptions)
        {
            Requires.NotNull(catalog, nameof(catalog));
            if (compositionOptions > (CompositionOptions.DisableSilentRejection | CompositionOptions.IsThreadSafe | CompositionOptions.ExportCompositionService))
            {
                throw new ArgumentOutOfRangeException(nameof(compositionOptions));
            }

            _catalog            = catalog;
            _compositionOptions = compositionOptions;
            var notifyCatalogChanged = _catalog as INotifyComposablePartCatalogChanged;

            if (notifyCatalogChanged != null)
            {
                notifyCatalogChanged.Changing += OnCatalogChanging;
            }

            CompositionScopeDefinition scopeDefinition = _catalog as CompositionScopeDefinition;

            if (scopeDefinition != null)
            {
                _innerExportProvider = new AggregateExportProvider(new ScopeManager(this, scopeDefinition), new InnerCatalogExportProvider(this));
            }
            else
            {
                _innerExportProvider = new InnerCatalogExportProvider(this);
            }
            _lock = new CompositionLock(compositionOptions.HasFlag(CompositionOptions.IsThreadSafe));
            _disableSilentRejection = compositionOptions.HasFlag(CompositionOptions.DisableSilentRejection);
        }
Ejemplo n.º 2
0
            public CompositionLockHolder(CompositionLock @lock)
            {
                _lock = @lock;

                _isDisposed = 0;
                _lock.EnterCompositionLock();
            }
Ejemplo n.º 3
0
            public CompositionLockHolder(CompositionLock @lock)
            {
                this._lock = @lock;

                this._isDisposed = 0;
                this._lock.EnterCompositionLock();
            }
Ejemplo n.º 4
0
        public ImportEngine(ExportProvider sourceProvider, bool isThreadSafe)
        {
            Requires.NotNull(sourceProvider, "sourceProvider");

            this._sourceProvider = sourceProvider;
            this._sourceProvider.ExportsChanging += this.OnExportsChanging;
            this._lock = new CompositionLock(isThreadSafe);
        }
Ejemplo n.º 5
0
        public ImportEngine(ExportProvider sourceProvider, bool isThreadSafe)
        {
            Requires.NotNull(sourceProvider, "sourceProvider");

            this._sourceProvider = sourceProvider;
            this._sourceProvider.ExportsChanging += this.OnExportsChanging;
            this._lock = new CompositionLock(isThreadSafe);
        }
Ejemplo n.º 6
0
        public ImportEngine(ExportProvider sourceProvider, CompositionOptions compositionOptions)
        {
            Requires.NotNull(sourceProvider, "sourceProvider");

            this._compositionOptions              = compositionOptions;
            this._sourceProvider                  = sourceProvider;
            this._sourceProvider.ExportsChanging += this.OnExportsChanging;
            this._lock = new CompositionLock(compositionOptions.HasFlag(CompositionOptions.IsThreadSafe));
        }
Ejemplo n.º 7
0
        public ImportEngine(ExportProvider sourceProvider, CompositionOptions compositionOptions)
        {
            Requires.NotNull(sourceProvider, nameof(sourceProvider));

            _compositionOptions              = compositionOptions;
            _sourceProvider                  = sourceProvider;
            _sourceProvider.ExportsChanging += OnExportsChanging;
            _lock = new CompositionLock(compositionOptions.HasFlag(CompositionOptions.IsThreadSafe));
        }
Ejemplo n.º 8
0
        public ImportEngine(ExportProvider sourceProvider, CompositionOptions compositionOptions)
        {
            Requires.NotNull(sourceProvider, "sourceProvider");

            this._compositionOptions = compositionOptions;
            this._sourceProvider = sourceProvider;
            this._sourceProvider.ExportsChanging += this.OnExportsChanging;
            this._lock = new CompositionLock(compositionOptions.HasFlag(CompositionOptions.IsThreadSafe));
        }
Ejemplo n.º 9
0
        public ComposablePartExportProvider(CompositionOptions compositionOptions)
        {
            if (compositionOptions > (CompositionOptions.DisableSilentRejection | CompositionOptions.IsThreadSafe | CompositionOptions.ExportCompositionService))
            {
                throw new ArgumentOutOfRangeException(nameof(compositionOptions));
            }

            _compositionOptions = compositionOptions;
            _lock = new CompositionLock(compositionOptions.HasFlag(CompositionOptions.IsThreadSafe));
        }
        public CatalogExportProvider(ComposablePartCatalog catalog, bool isThreadSafe)
        {
            Requires.NotNull(catalog, "catalog");

            this._catalog = catalog;

            var notifyCatalogChanged = this._catalog as INotifyComposablePartCatalogChanged;

            if (notifyCatalogChanged != null)
            {
                notifyCatalogChanged.Changing += this.OnCatalogChanging;
            }

            this._lock = new CompositionLock(isThreadSafe);
        }
 public ComposablePartExportProvider(bool isThreadSafe)
 {
     this._lock = new CompositionLock(isThreadSafe);
 }
Ejemplo n.º 12
0
            public CompositionLockHolder(CompositionLock @lock)
            {
                this._lock = @lock;

                this._isDisposed = 0;
                this._lock.EnterCompositionLock();
            }