本文整理汇总了C#中ModuleCatalog类的典型用法代码示例。如果您正苦于以下问题:C# ModuleCatalog类的具体用法?C# ModuleCatalog怎么用?C# ModuleCatalog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModuleCatalog类属于命名空间,在下文中一共展示了ModuleCatalog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetModuleCatalog
protected override IModuleCatalog GetModuleCatalog()
{
var catalog = new ModuleCatalog();
catalog.AddModule(typeof(BugReportModule));
return catalog;
}
示例2: ModuleInUnreferencedAssemblyInitializedByModuleInitializer
public void ModuleInUnreferencedAssemblyInitializedByModuleInitializer()
{
AssemblyCatalog assemblyCatalog = new AssemblyCatalog(GetPathToModuleDll());
CompositionContainer compositionContainer = new CompositionContainer(assemblyCatalog);
ModuleCatalog moduleCatalog = new ModuleCatalog();
Mock<MefFileModuleTypeLoader> mockFileTypeLoader = new Mock<MefFileModuleTypeLoader>();
compositionContainer.ComposeExportedValue<IModuleCatalog>(moduleCatalog);
compositionContainer.ComposeExportedValue<MefFileModuleTypeLoader>(mockFileTypeLoader.Object);
bool wasInit = false;
var mockModuleInitializer = new Mock<IModuleInitializer>();
mockModuleInitializer.Setup(x => x.Initialize(It.IsAny<ModuleInfo>())).Callback(() => wasInit = true);
var mockLoggerFacade = new Mock<ILoggerFacade>();
MefModuleManager moduleManager = new MefModuleManager(
mockModuleInitializer.Object,
moduleCatalog,
mockLoggerFacade.Object);
compositionContainer.SatisfyImportsOnce(moduleManager);
moduleManager.Run();
Assert.IsTrue(wasInit);
}
示例3: GetModuleCatalog
protected override IModuleCatalog GetModuleCatalog()
{
var catalog = new ModuleCatalog();
catalog.AddModule((typeof(MainModule)));
return catalog;
}
示例4: GetModuleCatalog
protected override IModuleCatalog GetModuleCatalog()
{
var catalog = new ModuleCatalog();
catalog.AddModule(typeof (EmployeeModule));
catalog.AddModule(typeof (TimesheetModule));
return catalog;
}
示例5: CreateModuleCatalog
protected override IModuleCatalog CreateModuleCatalog()
{
ModuleCatalog moduleCatalog = new ModuleCatalog();
moduleCatalog.AddModule(typeof(AdminModule));
moduleCatalog.AddModule(typeof(ArtistsModule));
return moduleCatalog;
}
示例6: UnknownExportedModuleIsAddedAndInitializedByModuleInitializer
public void UnknownExportedModuleIsAddedAndInitializedByModuleInitializer()
{
var aggregateCatalog = new AggregateCatalog();
var compositionContainer = new CompositionContainer(aggregateCatalog);
var moduleCatalog = new ModuleCatalog();
var mockModuleTypeLoader = new Mock<MefXapModuleTypeLoader>(new DownloadedPartCatalogCollection());
compositionContainer.ComposeExportedValue<IModuleCatalog>(moduleCatalog);
compositionContainer.ComposeExportedValue<MefXapModuleTypeLoader>(mockModuleTypeLoader.Object);
bool wasInit = false;
var mockModuleInitializer = new Mock<IModuleInitializer>();
mockModuleInitializer.Setup(x => x.Initialize(It.IsAny<ModuleInfo>())).Callback(() => wasInit = true);
var mockLoggerFacade = new Mock<ILoggerFacade>();
var moduleManager =
new MefModuleManager(mockModuleInitializer.Object, moduleCatalog, mockLoggerFacade.Object);
aggregateCatalog.Catalogs.Add(new TypeCatalog(typeof(TestMefModule)));
compositionContainer.SatisfyImportsOnce(moduleManager);
moduleManager.Run();
Assert.IsTrue(wasInit);
Assert.IsTrue(moduleCatalog.Modules.Any(mi => mi.ModuleName == "TestMefModule"));
}
示例7: CreateModuleCatalog
protected override Microsoft.Practices.Prism.Modularity.IModuleCatalog CreateModuleCatalog()
{
ModuleCatalog catalog = new ModuleCatalog();
catalog.AddModule(typeof(Module1.Module1));
catalog.AddModule(typeof(Module2.Module2));
return catalog;
}
示例8: CreateModuleCatalog
protected override IModuleCatalog CreateModuleCatalog()
{
base.ConfigureModuleCatalog();
ModuleCatalog modules = new ModuleCatalog();
modules.AddModule(typeof(PriceGridModule));
return modules;
}
示例9: CreateModuleCatalog
protected override Microsoft.Practices.Prism.Modularity.IModuleCatalog CreateModuleCatalog()
{
ModuleCatalog catalog = new ModuleCatalog();
catalog.AddModule(typeof(IssueLib.IssueModule));
catalog.AddModule(typeof(MapLib.MapModule));
catalog.AddModule(typeof(NavigationLib.NavigationModule));
return catalog;
}
示例10: GetModuleCatalog
protected override IModuleCatalog GetModuleCatalog()
{
var catalog = new ModuleCatalog();
catalog.AddModule(typeof(AngelSystemModule));
return catalog;
}
示例11: CreateModuleCatalog
/// <summary>
/// Creates the <see cref="T:Microsoft.Practices.Prism.Modularity.IModuleCatalog" /> used by Prism.
/// </summary>
/// <returns></returns>
/// <remarks>The base implementation returns a new ModuleCatalog.</remarks>
protected override IModuleCatalog CreateModuleCatalog()
{
ModuleCatalog catalog = new ModuleCatalog();
catalog.AddModule(typeof(NeurochipModule));
catalog.AddModule(typeof(GhostModule));
return catalog;
}
示例12: GetModuleCatalog
protected override IModuleCatalog GetModuleCatalog()
{
ModuleCatalog catalog = new ModuleCatalog()
.AddModule(typeof(LoginModule))
.AddModule(typeof(PleaseWaitModule))
.AddModule(typeof(CompaniesListModule));
return catalog;
}
示例13: CreateModuleCatalog
protected override IModuleCatalog CreateModuleCatalog()
{
var moduleCatalog = new ModuleCatalog();
// TODO: A more sofisticated method would
// be to get the modules from a Catalog.xaml file or a Web Service
moduleCatalog.AddModule(typeof (BasicAccountModule.BasicAccountModule));
return moduleCatalog;
}
示例14: GetModuleCatalog
protected override IModuleCatalog GetModuleCatalog()
{
var moduleCatalog = new ModuleCatalog();
foreach (var module in Container.GetAllInstances<IModule>())
{
moduleCatalog.AddModule(module.GetType());
}
return moduleCatalog;
}
示例15: CreateModuleCatalog
/// <summary>
/// Populates the Module Catalog.
/// </summary>
/// <returns>A new Module Catalog.</returns>
/// <remarks>
/// This method uses the Module Discovery method of populating the Module Catalog. It requires
/// a post-build event in each module to place the module assembly in the module catalog
/// directory.
/// </remarks>
protected override IModuleCatalog CreateModuleCatalog()
{
var moduleCatalog = new ModuleCatalog();
moduleCatalog.AddModule(typeof(SearchHelperModule));
moduleCatalog.AddModule(typeof(ReportsModule));
moduleCatalog.AddModule(typeof(AdminModule));
return moduleCatalog;
}