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);
        }
Esempio n. 2
0
            public CompositionLockHolder(CompositionLock @lock)
            {
                _lock = @lock;

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

                this._isDisposed = 0;
                this._lock.EnterCompositionLock();
            }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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);
 }
Esempio n. 12
0
            public CompositionLockHolder(CompositionLock @lock)
            {
                this._lock = @lock;

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