本文整理汇总了C#中ComposablePartCatalog类的典型用法代码示例。如果您正苦于以下问题:C# ComposablePartCatalog类的具体用法?C# ComposablePartCatalog怎么用?C# ComposablePartCatalog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComposablePartCatalog类属于命名空间,在下文中一共展示了ComposablePartCatalog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: NetworkAwareCatalog
public NetworkAwareCatalog(ComposablePartCatalog filteredCatalog)
{
_networkStatus = (NetworkInterface.GetIsNetworkAvailable()) ? "Online" : "Offline";
NetworkChange.NetworkAvailabilityChanged += new NetworkAvailabilityChangedEventHandler(NetworkAvailabilityChanged);
_filteredCatalog = filteredCatalog;
}
开发者ID:Helen1987,项目名称:edu,代码行数:7,代码来源:NetworkAwareCatalog.cs
示例2: FilteredCatalog
public FilteredCatalog(ComposablePartCatalog inner,
Func<ComposablePartDefinition, bool> filter)
{
_inner = inner;
_innerNotifyChange = inner as INotifyComposablePartCatalogChanged;
_partsQuery = inner.Parts.Where(filter).AsQueryable();
}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:CatalogFactory.FilteredComposablePartCatalog.cs
示例3: CompositionService
internal CompositionService(ComposablePartCatalog composablePartCatalog)
{
Assumes.NotNull(composablePartCatalog);
this._notifyCatalog = composablePartCatalog as INotifyComposablePartCatalogChanged;
try
{
if(this._notifyCatalog != null)
{
this._notifyCatalog.Changing += this.OnCatalogChanging;
}
var compositionOptions = CompositionOptions.DisableSilentRejection | CompositionOptions.IsThreadSafe | CompositionOptions.ExportCompositionService;
var compositionContainer = new CompositionContainer(composablePartCatalog, compositionOptions);
this._compositionContainer = compositionContainer;
}
catch
{
if(this._notifyCatalog != null)
{
this._notifyCatalog.Changing -= this.OnCatalogChanging;
}
throw;
}
}
开发者ID:nlhepler,项目名称:mono,代码行数:25,代码来源:CompositionService.cs
示例4: CompositionScopeDefinition
/// <summary>
/// Initializes a new instance of the <see cref="CompositionScopeDefinition"/> class.
/// </summary>
/// <param name="catalog">The catalog.</param>
/// <param name="children">The children.</param>
public CompositionScopeDefinition(ComposablePartCatalog catalog, IEnumerable<CompositionScopeDefinition> children)
{
Requires.NotNull(catalog, "catalog");
Requires.NullOrNotNullElements(children, "children");
InitializeCompositionScopeDefinition(catalog, children, null);
}
开发者ID:nlhepler,项目名称:mono,代码行数:12,代码来源:CompositionScopeDefinition.cs
示例5: GenericCatalog
public GenericCatalog(ComposablePartCatalog catalog)
{
_decoratedCatalog = catalog;
_catalog.Catalogs.Add(_decoratedCatalog);
_catalog.Changing += (s, e) => { OnChanging(e); };
LoadTypeLocators(_genericTypes);
}
开发者ID:jbogard,项目名称:MefContrib,代码行数:7,代码来源:GenericCatalog.cs
示例6: MefUnityContainerExtension
public MefUnityContainerExtension(ComposablePartCatalog catalog, bool register, params ExportProvider[] providers)
{
Debug.Assert(catalog != null);
m_Catalog = catalog;
m_Register = register;
m_Providers = providers;
}
开发者ID:pwlodek,项目名称:CodeGallery,代码行数:7,代码来源:MefUnityContainerExtension.cs
示例7: Document
/// <summary>
/// Initializes a new instance.
/// </summary>
/// <param name="xml"></param>
/// <param name="catalog"></param>
/// <param name="exports"></param>
Document(
Func<Document, XDocument> xml,
ComposablePartCatalog catalog,
ExportProvider exports)
{
Contract.Requires<ArgumentNullException>(xml != null);
// configure composition
this.configuration = GetConfiguration(catalog, exports);
this.container = new CompositionContainer(configuration.HostCatalog, true, new CompositionContainer(configuration.GlobalCatalog, true, configuration.Exports));
this.container.GetExportedValue<DocumentEnvironment>().SetHost(this);
// required services
this.invoker = container.GetExportedValue<IInvoker>();
this.trace = container.GetExportedValue<ITraceService>();
// initialize xml
this.xml = xml(this);
this.xml.AddAnnotation(this);
// parallel initialization of common interfaces
Parallel.ForEach(this.xml.DescendantNodesAndSelf(), i =>
{
Enumerable.Empty<object>()
.Concat(i.Interfaces<IOnInit>())
.Concat(i.Interfaces<IOnLoad>())
.ToLinkedList();
});
// initial invocation entry
this.invoker.Invoke(() => { });
}
开发者ID:nxkit,项目名称:nxkit,代码行数:38,代码来源:Document.cs
示例8: TouchCatalog
public static async Task TouchCatalog(ComposablePartCatalog composablePartCatalog)
{
var aggregate = composablePartCatalog as AggregateCatalog;
if (aggregate != null)
{
//foreach (var catalog in aggregate.Catalogs)
//{
// TouchCatalog(catalog);
//}
var actionList = new List<Task>();
foreach (var item in aggregate.Catalogs)
{
actionList.Add(TouchCatalog(item));
}
await Task.WhenAll(actionList.ToArray());
}
else
{
var metadataAssemblyCatalog = composablePartCatalog as MetadataAssemblyCatalog;
if (metadataAssemblyCatalog != null)
{
await metadataAssemblyCatalog.Realize();
}
foreach (var part in composablePartCatalog.Parts)
{
TouchPart(part);
}
}
}
开发者ID:KirillOsenkov,项目名称:MEFMetadata,代码行数:32,代码来源:CompositionDumper.cs
示例9: SelectParts
public IQueryable<ComposablePart> SelectParts(ComposablePartCatalog catalog)
{
var parts = from part in catalog.Parts
where part.ExportDefinitions.Any(d => d.ContractName == typeof(IOperatorsPackage).FullName)
select part.CreatePart();
return parts;
}
开发者ID:Refresh06,项目名称:visualmutator,代码行数:7,代码来源:MEFOperatorLoader.cs
示例10: FilteredCatalog
/// <summary>
/// Initializes a new instance of the FilteredCatalog class with the specified underlying
/// catalog and filter.
/// </summary>
public FilteredCatalog(ComposablePartCatalog inner,
Expression<Func<ComposablePartDefinition, bool>> expression)
{
_inner = inner;
_innerNotifyChange = inner as INotifyComposablePartCatalogChanged;
_partsQuery = inner.Parts.Where(expression);
}
开发者ID:regnrand,项目名称:chorus,代码行数:11,代码来源:FilteredCatalog.cs
示例11: MEFedMVVMExportProvider
public MEFedMVVMExportProvider(ComposablePartCatalog catalog)
{
_exportProvider = new CatalogExportProvider(catalog);
//support recomposition
_exportProvider.ExportsChanged += (s, e) => OnExportsChanged(e);
_exportProvider.ExportsChanging += (s, e) => OnExportsChanging(e);
}
开发者ID:JoeGilkey,项目名称:RadioLog,代码行数:7,代码来源:MEFedMVVMExportProvider.cs
示例12: ScopeCatalog
/// <summary>
/// Initializes a new instance.
/// </summary>
/// <param name="parent"></param>
/// <param name="scope"></param>
public ScopeCatalog(ComposablePartCatalog parent, Scope scope)
: base(parent, GetFilter(scope))
{
Contract.Requires<ArgumentNullException>(parent != null);
this.scope = scope;
}
开发者ID:nxkit,项目名称:nxkit,代码行数:12,代码来源:ScopeCatalog.cs
示例13: ScopedContainerManager
public ScopedContainerManager(ComposablePartCatalog rootCatalog)
{
if (rootCatalog == null) throw new ArgumentNullException("rootCatalog");
_rootCatalog = rootCatalog;
_container = new CompositionContainer(new FilteredCatalog(rootCatalog, def => GetAllWithinAppScope(def)), true);
}
开发者ID:chrisortman,项目名称:Ketchup.Web,代码行数:8,代码来源:ScopedContainerManager.cs
示例14: RegisterCatalog
/// <summary>
/// Registers a MEF catalog within Unity container.
/// </summary>
/// <param name="unityContainer">Unity container instance.</param>
/// <param name="catalog">MEF catalog to be registered.</param>
/// <param name="isThreadSafe">Indicates if MEF should be thread safe.</param>
public static void RegisterCatalog(this IUnityContainer unityContainer, ComposablePartCatalog catalog, bool isThreadSafe = false)
{
lock (unityContainer)
{
var compositionIntegration = EnableCompositionIntegration(unityContainer, isThreadSafe);
compositionIntegration.Catalogs.Add(catalog);
}
}
开发者ID:doublekill,项目名称:MefContrib,代码行数:14,代码来源:UnityContainerExtensions.cs
示例15: CatalogChangeProxy
public CatalogChangeProxy(ComposablePartCatalog originalCatalog,
IEnumerable<ComposablePartDefinition> addedParts,
IEnumerable<ComposablePartDefinition> removedParts)
{
this._originalCatalog = originalCatalog;
this._addedParts = new List<ComposablePartDefinition>(addedParts);
this._removedParts = new HashSet<ComposablePartDefinition>(removedParts);
}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:CatalogExportProvider.CatalogChangeProxy.cs
示例16: ForceFieldContainer
public ForceFieldContainer(ComposablePartCatalog catalog, Configuration config)
: base(catalog)
{
Guard.ArgumentIsNotNull(() => catalog, () => config);
_config = config;
_config.SetInnerContainer(this);
}
开发者ID:JakobOoms,项目名称:ForceField,代码行数:8,代码来源:ForceFieldContainer.cs
示例17: CatalogContractInformationProvider
public CatalogContractInformationProvider(ComposablePartCatalog catalog)
{
_catalog = catalog;
var changeableCatalog = _catalog as INotifyComposablePartCatalogChanged;
if (changeableCatalog != null)
{
changeableCatalog.Changed +=new EventHandler<ComposablePartCatalogChangeEventArgs>(catalog_Changed);
}
}
开发者ID:dsplaisted,项目名称:MEFContractDiscovery,代码行数:9,代码来源:CatalogContractDiscovery.cs
示例18: Create
public static CompositionContainer Create(ComposablePartCatalog catalog)
{
var container = new CompositionContainer(new AggregateCatalog(catalog,
new TypeCatalog(typeof(CompositionContainer))));
container.ComposeExportedValue<CompositionContainer>(container);
return container;
}
开发者ID:chgeuer,项目名称:WCFplusMEFSample,代码行数:9,代码来源:CompositionContainerFactory.cs
示例19: Constructor3_ArrayWithNullAsCatalogsArgument_ShouldThrowArgument
public void Constructor3_ArrayWithNullAsCatalogsArgument_ShouldThrowArgument()
{
var catalogs = new ComposablePartCatalog[] { null };
ExceptionAssert.ThrowsArgument<ArgumentException>("catalogs", () =>
{
new AggregateCatalog(catalogs);
});
}
开发者ID:nlhepler,项目名称:mono,代码行数:9,代码来源:AggregateCatalogTest.cs
示例20: ProxyCatalog
/// <summary>
/// Initializes a new instance of the <see cref="ProxyCatalog"/> class.
/// </summary>
/// <param name="innerCatalog">The inner catalog.</param>
public ProxyCatalog(ComposablePartCatalog innerCatalog)
{
this.innerCatalog = innerCatalog;
parts = CreateFrom(this.innerCatalog);
var notifyingCatalog = this.innerCatalog as INotifyComposablePartCatalogChanged;
if(notifyingCatalog != null)
notifyingCatalog.Changing += NotifyingCatalog_Changing;
}
开发者ID:ssethi,项目名称:TestFrameworks,代码行数:13,代码来源:ProxyCatalog.cs
注:本文中的ComposablePartCatalog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论