Ejemplo n.º 1
0
 protected override IModuleCatalog CreateModuleCatalog()
 {
     ModuleCatalog moduleCatalog = new ModuleCatalog();
     moduleCatalog.AddModule(typeof(AdminModule));
     moduleCatalog.AddModule(typeof(ArtistsModule));
     return moduleCatalog;
 }
Ejemplo n.º 2
0
		protected override Microsoft.Practices.Prism.Modularity.IModuleCatalog CreateModuleCatalog()
		{
			ModuleCatalog catalog = new ModuleCatalog();
			catalog.AddModule(typeof(Module1.Module1));
			catalog.AddModule(typeof(Module2.Module2));
			return catalog;
		}
Ejemplo n.º 3
0
 protected override IModuleCatalog GetModuleCatalog()
 {
     var catalog = new ModuleCatalog();
     catalog.AddModule(typeof (EmployeeModule));
     catalog.AddModule(typeof (TimesheetModule));
     return catalog;
 }
 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;
 }
Ejemplo n.º 5
0
        /// <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;
        }
Ejemplo n.º 6
0
        /// <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;
        }
Ejemplo n.º 7
0
        protected override IModuleCatalog GetModuleCatalog()
        {
            var catalog = new ModuleCatalog();

            catalog.AddModule(typeof(ClientModule));
            catalog.AddModule(typeof(AngelSystemModule));
            catalog.AddModule(typeof(CourseModule.CourseModule));

            return catalog;
        }
Ejemplo n.º 8
0
        public ModuleCatalog GetRegisteredModules()
        {
            // Register services before loading catalogs and regions
            ServicesRegistrator();

            var catalog = new ModuleCatalog();
            catalog.AddModule(typeof(NavigationModule));
            catalog.AddModule(typeof(HomeModule));
            catalog.AddModule(typeof(ArtistModule));
            catalog.AddModule(typeof(UserModule));

            return catalog;
        }
Ejemplo n.º 9
0
        protected override IModuleCatalog GetModuleCatalog()
        {
            string query = App.Current.Host.Source.Query;
            var level1 = new ModuleInfo(ModuleNames.level1, string.Format("{0}.Level1Module, {0}, Version=1.0.0.0", ModuleNames.level1)) { InitializationMode = InitializationMode.OnDemand, Ref = ModuleNames.level1 + ".xap" };
            var level2 = new ModuleInfo(ModuleNames.level2, string.Format("{0}.Level2Module, {0}, Version=1.0.0.0",ModuleNames.level2)) { InitializationMode = InitializationMode.OnDemand, Ref = ModuleNames.level2 + ".xap" };
            var level3 = new ModuleInfo(ModuleNames.level3, string.Format("{0}.Level3Module, {0}, Version=1.0.0.0", ModuleNames.level3)) { InitializationMode = InitializationMode.OnDemand, Ref = ModuleNames.level3 + ".xap" };
            var level4 = new ModuleInfo(ModuleNames.level4, string.Format("{0}.Level4Module, {0}, Version=1.0.0.0", ModuleNames.level4)) { InitializationMode = InitializationMode.OnDemand, Ref = ModuleNames.level4 + ".xap" };

            ModuleCatalog cat = new ModuleCatalog();
            cat.AddModule(level1);
            cat.AddModule(level2);
            cat.AddModule(level3);
            cat.AddModule(level4);
            return cat;
        }
Ejemplo n.º 10
0
    /// <summary>
    /// Populates the Module Catalog.
    /// </summary>
    /// <returns>A new Module Catalog.</returns>
    protected override IModuleCatalog CreateModuleCatalog()
    {
      /// The most direct way to create a module catalog is to create it in code.
      var moduleCatalog = new ModuleCatalog();

      // Add the Dashboard Module to the catalog using code.
      Type dashboardModule = typeof(DashboardModule);
      moduleCatalog.AddModule(new ModuleInfo() { ModuleName = dashboardModule.Name, ModuleType = dashboardModule.AssemblyQualifiedName });

      // Add the Customers Module to the catalog using code.
      Type customerModule = typeof(CustomersModule);
      moduleCatalog.AddModule(new ModuleInfo() { ModuleName = customerModule.Name, ModuleType = customerModule.AssemblyQualifiedName });

      return moduleCatalog;
    }
Ejemplo n.º 11
0
        protected override IModuleCatalog GetModuleCatalog()
        {
            var catalog = new ModuleCatalog();
            catalog.AddModule((typeof(MainModule)));

            return catalog;
        }
Ejemplo n.º 12
0
        protected override IModuleCatalog GetModuleCatalog()
        {
            var moduleCatalog = new ModuleCatalog();
            if ((_modules & Modules.Security) == Modules.Security)
                moduleCatalog.AddModule(typeof(SecurityModule));
            if ((_modules & Modules.Associations) == Modules.Associations)
                moduleCatalog.AddModule(typeof(AssociationsModule));
            if ((_modules & Modules.ClientLogin) == Modules.ClientLogin)
                moduleCatalog.AddModule(typeof(ClientLoginModule));
            if ((_modules & Modules.ClientPasswordRecovery) == Modules.ClientPasswordRecovery)
                moduleCatalog.AddModule(typeof(ClientPasswordRecoveryModule));
            if ((_modules & Modules.ClientRegistration) == Modules.ClientRegistration)
                moduleCatalog.AddModule(typeof(ClientRegistrationModule));

            return moduleCatalog;
        }
Ejemplo n.º 13
0
        protected override IModuleCatalog GetModuleCatalog()
        {
            var catalog = new ModuleCatalog();
              catalog.AddModule(typeof(BugReportModule));

              return catalog;
        }
Ejemplo n.º 14
0
        protected override void ConfigureModuleCatalog()
        {
            base.ConfigureModuleCatalog();

            ModuleCatalog moduleCatalog = this.ModuleCatalog as ModuleCatalog;

            moduleCatalog?.AddModule(typeof(VRChatUtilModule.VRChatUtilModule));
        }
Ejemplo n.º 15
0
        protected override IModuleCatalog CreateModuleCatalog()
        {
            base.ConfigureModuleCatalog();

            ModuleCatalog modules = new ModuleCatalog();
            modules.AddModule(typeof(PriceGridModule));
            return modules;  
        }
Ejemplo n.º 16
0
        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;
        }
 protected override IModuleCatalog GetModuleCatalog()
 {
     var moduleCatalog = new ModuleCatalog();
     foreach (var module in Container.GetAllInstances<IModule>())
     {
         moduleCatalog.AddModule(module.GetType());
     }
     return moduleCatalog;
 }
Ejemplo n.º 18
0
        // In silverlight, the REF value will likely be the URL to the XAP file where you can download the file
        // For example:
        // const string refValue = "url://servername/ModuleB.xap";
        // In this quickstart, this is not needed, because the ModuleB is already present. 

        // In WPF, the REF value will likely be the location where the system can find the file, if the path 
        // is not in the normal .net Assembly probe paths. For example:
        // const string refValue = "file://c:/Modules/ModuleB.dll";
      
        protected override IModuleCatalog GetModuleCatalog()
        {
            ModuleCatalog catalog = new ModuleCatalog();

            // There are two ways of adding modules to the catalog in code
            // 1: If the shell has a direct reference to the modules, you can use
            //    typeof(Module) to add the module. 
            catalog.AddModule(typeof (ModuleA), "ModuleD")
                .AddModule(typeof (ModuleD), "ModuleB")
                .AddModule(typeof (ModuleC), InitializationMode.OnDemand)
                ;

            // 2: If the shell does not have a direct reference to the module, you have to
            //    specify the Assembly qualified typename. You might also have to specify where the 
            //    file can be found by specifying a 'Ref' value. (In this example it's not needed,
            //    because the assembly is in the .net probe path)
            catalog.AddModule(new ModuleInfo("ModuleB", moduleBAssemblyQualifiedName));
                
            return catalog;
        }
Ejemplo n.º 19
0
        protected override IModuleCatalog CreateModuleCatalog()
        {
            ModuleCatalog moduleCatalog = new ModuleCatalog();

            moduleCatalog.AddModule(new ModuleInfo
            {
                InitializationMode = InitializationMode.OnDemand,
                Ref = "CAAC.CAFM.xap",
                ModuleName = "CAFMModule",
                ModuleType = "CAAC.CAFM.CAFMModule, CAAC.CAFM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            });

            moduleCatalog.AddModule(new ModuleInfo
            {
                InitializationMode = InitializationMode.OnDemand,
                Ref = "UniCloud.UniAuth.xap",
                ModuleName = "UniAuthModule",
                ModuleType = "UniCloud.UniAuth.UniAuthModule, UniCloud.UniAuth, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            });

            return moduleCatalog;
        }
Ejemplo n.º 20
0
        protected override Microsoft.Practices.Prism.Modularity.IModuleCatalog CreateModuleCatalog()
        {
            ModuleCatalog moduleCatalog = new ModuleCatalog();

            // this is the code responsible 
            // for adding Module1 to the application
            moduleCatalog.AddModule
            (
                typeof(Zieschang.Net.Projects.SLJiraClient.DashboardModule.Module)
            );

            return moduleCatalog;
        }
Ejemplo n.º 21
0
        protected override IModuleCatalog CreateModuleCatalog()
        {
            var catalog = new ModuleCatalog();

            catalog.AddModule(typeof (InfrastructureServicesModule));
            catalog.AddModule(typeof(DalModule));
            catalog.AddModule(typeof(ServicesModule));

            catalog.AddModule(typeof(DesignServicesModule));
            catalog.AddModule(typeof(DesignClientRequestModule));
            catalog.AddModule(typeof (DesignContractorsModule));
            catalog.AddModule(typeof (HangarEditModule));
            catalog.AddModule(typeof (CatalogsModule));
            return catalog;
        }
        protected override IModuleCatalog CreateModuleCatalog()
        {
            var catalog = new ModuleCatalog();

            catalog.AddModule(typeof(MenuModule));
            catalog.AddModule(typeof(OrderListModule));
            catalog.AddModule(typeof(PagingModule));
            catalog.AddModule(typeof(FilterModule));
            catalog.AddModule(typeof(LoaderModule));

            catalog.AddModule(typeof(NavigationModule));
            catalog.AddModule(typeof(EditorModule));
            catalog.AddModule(typeof(SummaryModule));

            return(catalog);
        }
Ejemplo n.º 23
0
        // TODO: 02 - The Shell loads the ElevatorApp.UI, as specified in the module catalog (ModuleCatalog.xaml).
        #region  Methods

        /// <summary>
        /// Configures the module catalog. Modularity is a one best approach for big scale projects
        /// </summary>
        ///

        //protected override IModuleCatalog CreateModuleCatalog()
        //{
        //    return new AggregateModuleCatalog();
        //}
        protected override void ConfigureModuleCatalog()
        {
            base.ConfigureModuleCatalog();
            // Module B and Module D are copied to a directory as part of a post-build step.
            // These modules are not referenced in the project and are discovered by inspecting a directory.
            // Both projects have a post-build step to copy themselves into that directory.
            //DirectoryModuleCatalog directoryCatalog = new DirectoryModuleCatalog() { ModulePath = @".\DirectoryModules" };
            //((AggregateModuleCatalog)ModuleCatalog).AddCatalog(directoryCatalog);


            ModuleCatalog moduleCatalog = (ModuleCatalog)this.ModuleCatalog;

            moduleCatalog.AddModule(typeof(ModuleInit));
        }
Ejemplo n.º 24
0
        protected override void ConfigureModuleCatalog()
        {
            base.ConfigureModuleCatalog();

            var mainModule = typeof(MainModule);

            ModuleCatalog.AddModule(new ModuleInfo
            {
                ModuleName         = mainModule.Name,
                ModuleType         = mainModule.AssemblyQualifiedName,
                Ref                = new Uri(mainModule.Assembly.Location).AbsoluteUri,
                InitializationMode = InitializationMode.WhenAvailable,
            });
        }
Ejemplo n.º 25
0
        protected override void ConfigureModuleCatalog()
        {
            //var moduleCatalog = (ModuleCatalog)ModuleCatalog;

            ModuleCatalog.AddModule(new ModuleInfo()
            {
                ModuleName         = "Module.Display",
                ModuleType         = "Digital_Indicator.Module.Display.DisplayModule, Digital_Indicator.Module.Display",
                InitializationMode = InitializationMode.WhenAvailable,
            });


            //moduleCatalog.AddModule(typeof(YOUR_MODULE));
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Populates the Module Catalog.
        /// </summary>
        /// <returns>A new Module Catalog.</returns>
        protected override IModuleCatalog CreateModuleCatalog()
        {
            /// The most direct way to create a module catalog is to create it in code.
            var moduleCatalog = new ModuleCatalog();

            // Add the Dashboard Module to the catalog using code.
            Type dashboardModule = typeof(DashboardModule);

            moduleCatalog.AddModule(new ModuleInfo()
            {
                ModuleName = dashboardModule.Name, ModuleType = dashboardModule.AssemblyQualifiedName
            });

            // Add the Customers Module to the catalog using code.
            Type customerModule = typeof(CustomersModule);

            moduleCatalog.AddModule(new ModuleInfo()
            {
                ModuleName = customerModule.Name, ModuleType = customerModule.AssemblyQualifiedName
            });

            return(moduleCatalog);
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Configures the <see cref="IModuleCatalog"/> used by Prism.
        /// </summary>
        protected override void ConfigureModuleCatalog()
        {
            // Module A is defined in the code.
            Type moduleAType = typeof(ModuleA.ModuleA);

            ModuleCatalog.AddModule(new ModuleInfo(moduleAType.Name, moduleAType.AssemblyQualifiedName, WellKnownModuleNames.ModuleD));

            // Module C is defined in the code.
            Type moduleCType = typeof(ModuleC.ModuleC);

            ModuleCatalog.AddModule(new ModuleInfo {
                ModuleName = moduleCType.Name, ModuleType = moduleCType.AssemblyQualifiedName, InitializationMode = InitializationMode.OnDemand
            });
        }
Ejemplo n.º 28
0
        protected override void ConfigureModuleCatalog()
        {
            base.ConfigureModuleCatalog();
            Type module2Type = typeof(RestaurantModule.RestaurantModule);

            ModuleCatalog.AddModule
            (
                new Prism.Modularity.ModuleInfo
            {
                ModuleName = module2Type.Name,
                ModuleType = module2Type.AssemblyQualifiedName
            }
            );
        }
Ejemplo n.º 29
0
        public void CanAddModule2()
        {
            ModuleCatalog catalog = new ModuleCatalog();

            catalog.AddModule("Module", "ModuleType", "DependsOn1", "DependsOn2");

            Assert.Single(catalog.Modules);
            Assert.Equal("Module", catalog.Modules.First().ModuleName);
            Assert.Equal("ModuleType", catalog.Modules.First().ModuleType);
            Assert.Equal(InitializationMode.WhenAvailable, catalog.Modules.First().InitializationMode);
            Assert.Equal(2, catalog.Modules.First().DependsOn.Count);
            Assert.Equal("DependsOn1", catalog.Modules.First().DependsOn[0]);
            Assert.Equal("DependsOn2", catalog.Modules.First().DependsOn[1]);
        }
Ejemplo n.º 30
0
        public void StartupModuleDependentOnAnOnDemandModuleThrows()
        {
            var catalog        = new ModuleCatalog();
            var moduleOnDemand = CreateModuleInfo("ModuleA");

            moduleOnDemand.InitializationMode = InitializationMode.OnDemand;
            catalog.AddModule(moduleOnDemand);
            catalog.AddModule(CreateModuleInfo("ModuleB", "ModuleA"));

            try
            {
                catalog.Validate();
            }
            catch (Exception ex)
            {
                Assert.IsInstanceOfType(ex, typeof(ModularityException));
                Assert.AreEqual("ModuleB", ((ModularityException)ex).ModuleName);

                return;
            }

            Assert.Fail("Exception not thrown.");
        }
Ejemplo n.º 31
0
        public void CanAddModule3()
        {
            ModuleCatalog catalog = new ModuleCatalog();

            catalog.AddModule(typeof(MockModule), InitializationMode.OnDemand, "DependsOn1", "DependsOn2");

            Assert.Single(catalog.Modules);
            Assert.Equal("MockModule", catalog.Modules.First().ModuleName);
            Assert.Equal(typeof(MockModule).AssemblyQualifiedName, catalog.Modules.First().ModuleType);
            Assert.Equal(InitializationMode.OnDemand, catalog.Modules.First().InitializationMode);
            Assert.Equal(2, catalog.Modules.First().DependsOn.Count);
            Assert.Equal("DependsOn1", catalog.Modules.First().DependsOn[0]);
            Assert.Equal("DependsOn2", catalog.Modules.First().DependsOn[1]);
        }
Ejemplo n.º 32
0
        public void CanAddModule1()
        {
            ModuleCatalog catalog = new ModuleCatalog();

            catalog.AddModule("Module", "ModuleType", InitializationMode.OnDemand, "DependsOn1", "DependsOn2");

            Assert.AreEqual(1, catalog.Modules.Count());
            Assert.AreEqual("Module", catalog.Modules.First().ModuleName);
            Assert.AreEqual("ModuleType", catalog.Modules.First().ModuleType);
            Assert.AreEqual(InitializationMode.OnDemand, catalog.Modules.First().InitializationMode);
            Assert.AreEqual(2, catalog.Modules.First().DependsOn.Count);
            Assert.AreEqual("DependsOn1", catalog.Modules.First().DependsOn[0]);
            Assert.AreEqual("DependsOn2", catalog.Modules.First().DependsOn[1]);
        }
Ejemplo n.º 33
0
        public void CanAddModule4()
        {
            ModuleCatalog catalog = new ModuleCatalog();

            catalog.AddModule(typeof(MockModule), "DependsOn1", "DependsOn2");

            Assert.AreEqual(1, catalog.Modules.Count());
            Assert.AreEqual("MockModule", catalog.Modules.First().ModuleName);
            Assert.AreEqual(typeof(MockModule).AssemblyQualifiedName, catalog.Modules.First().ModuleType);
            Assert.AreEqual(InitializationMode.WhenAvailable, catalog.Modules.First().InitializationMode);
            Assert.AreEqual(2, catalog.Modules.First().DependsOn.Count);
            Assert.AreEqual("DependsOn1", catalog.Modules.First().DependsOn[0]);
            Assert.AreEqual("DependsOn2", catalog.Modules.First().DependsOn[1]);
        }
Ejemplo n.º 34
0
        protected override void ConfigureModuleCatalog()
        {
            base.ConfigureModuleCatalog();
            ModuleCatalog moduleCatalog = (ModuleCatalog)this.ModuleCatalog;

            moduleCatalog.AddModule(typeof(OobeModule.OobeModule));
            moduleCatalog.AddModule(typeof(ControlsModule.ControlsModule));
            moduleCatalog.AddModule(typeof(CollectionModule.CollectionModule));
            moduleCatalog.AddModule(typeof(InformationModule.InformationModule));
            moduleCatalog.AddModule(typeof(SettingsModule.SettingsModule));
            moduleCatalog.AddModule(typeof(FullPlayerModule.FullPlayerModule));
            moduleCatalog.AddModule(typeof(MiniPlayerModule.MiniPlayerModule));
        }
        protected override void ConfigureModuleCatalog()
        {
            base.ConfigureModuleCatalog();
            ModuleCatalog moduleCatalog = (ModuleCatalog)this.ModuleCatalog;

            moduleCatalog.AddModule(typeof(BadgerControlModule.BadgerControlModule));

            /*
             * moduleCatalog.AddModule(typeof(BadgerControlModule.Views.BadgerControlConnectionView));
             * moduleCatalog.AddModule(typeof(BadgerControlModule.Views.BadgerControlDriveView));
             * moduleCatalog.AddModule(typeof(BadgerControlModule.Views.BadgerControlStatusView));
             * moduleCatalog.AddModule(typeof(BadgerControlModule.Views.BadgerControlLoggerView));
             * moduleCatalog.AddModule(typeof(BadgerControlModule.Views.BadgerControlVisualView));
             * */
        }
Ejemplo n.º 36
0
        protected override IModuleCatalog CreateModuleCatalog()
        {
            var catalog = new ModuleCatalog();

            catalog.AddModule(typeof(UiModule));

            AddModuleByRole(catalog, typeof(DirectorModule));
            AddModuleByRole(catalog, typeof(SalesModule));
            AddModuleByRole(catalog, typeof(PlanAndEconomyModule));
            AddModuleByRole(catalog, typeof(PriceMakingModule));
            AddModuleByRole(catalog, typeof(SupplyModule));
            AddModuleByRole(catalog, typeof(ProductsModule));
            AddModuleByRole(catalog, typeof(DirectumLiteModule));
            AddModuleByRole(catalog, typeof(BookRegistrationModule));
            AddModuleByRole(catalog, typeof(ReportsModule));

            //catalog.AddModule(typeof(MessengerModule));
            catalog.AddModule(typeof(BaseEntitiesModule));
            catalog.AddModule(typeof(SettingsModule));

            _modules = catalog.Modules.ToList();

            return(catalog);
        }
Ejemplo n.º 37
0
        protected override void ConfigureModuleCatalog()
        {
            base.ConfigureModuleCatalog();

            // Register the disk selection view module
            var diskSelectionModuleType = typeof(Modules.DiskSelectionModule);

            var diskSelectionModule = new Prism.Modularity.ModuleInfo
            {
                ModuleName = diskSelectionModuleType.Name,
                ModuleType = diskSelectionModuleType.AssemblyQualifiedName,
            };

            ModuleCatalog.AddModule(diskSelectionModule);
        }
Ejemplo n.º 38
0
 protected override void ConfigureModuleCatalog()
 {
     ModuleCatalog.AddModule(new ModuleInfo()
     {
         InitializationMode = InitializationMode.WhenAvailable,
         ModuleName = KnownModuleNames.ModuleDummy,
         ModuleType = typeof(DummyModule.DummyModule).AssemblyQualifiedName
     });
     ModuleCatalog.AddModule(new ModuleInfo()
     {
         InitializationMode = InitializationMode.WhenAvailable,
         ModuleName = KnownModuleNames.ModuleDummy2,
         ModuleType = typeof(DummyModule2.DummyModule2).AssemblyQualifiedName
     });
 }
        public void DeclaredModuleWithTypeInUnreferencedAssemblyIsUpdatedWithTypeNameFromExportAttribute()
        {
            AggregateCatalog     aggregateCatalog     = new AggregateCatalog();
            CompositionContainer compositionContainer = new CompositionContainer(aggregateCatalog);

            var mockFileTypeLoader = new Mock <MefFileModuleTypeLoader>();

            mockFileTypeLoader.Setup(tl => tl.CanLoadModuleType(It.IsAny <ModuleInfo>())).Returns(true);


            ModuleCatalog moduleCatalog = new ModuleCatalog();
            ModuleInfo    moduleInfo    = new ModuleInfo {
                ModuleName = "MefModuleOne", ModuleType = "some type"
            };

            moduleCatalog.AddModule(moduleInfo);

            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.IsFalse(wasInit);

            AssemblyCatalog assemblyCatalog = new AssemblyCatalog(GetPathToModuleDll());

            aggregateCatalog.Catalogs.Add(assemblyCatalog);

            compositionContainer.SatisfyImportsOnce(moduleManager);

            mockFileTypeLoader.Raise(tl => tl.LoadModuleCompleted += null, new LoadModuleCompletedEventArgs(moduleInfo, null));

            Assert.AreEqual("MefModulesForTesting.MefModuleOne, MefModulesForTesting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", moduleInfo.ModuleType);
            Assert.IsTrue(wasInit);
        }
        /// <summary>
        /// Configures the module catalog.
        /// </summary>
        protected override void ConfigureModuleCatalog()
        {
            /*
             * The ModuleCatalog class holds information about th  modules that can be used by the applicaiton.
             * ModuleInfo class tha records the name, type, and location, among the attributes on of the module.
             */

            ModuleCatalog moduleCatalog = (ModuleCatalog)this.ModuleCatalog;

            moduleCatalog.AddModule(typeof(SDN.Navigation.NavigationModule));

            Type moduleCType = typeof(SDN.Sales.SalesModule);

            this.ModuleCatalog.AddModule(new ModuleInfo()
            {
                ModuleName         = moduleCType.Name,
                ModuleType         = moduleCType.AssemblyQualifiedName,
                InitializationMode = InitializationMode.OnDemand
            });

            Type moduleCType2 = typeof(SDN.Purchasing.PurchasingModule);

            this.ModuleCatalog.AddModule(new ModuleInfo()
            {
                ModuleName         = moduleCType2.Name,
                ModuleType         = moduleCType2.AssemblyQualifiedName,
                InitializationMode = InitializationMode.OnDemand
            });

            Type moduleCType3 = typeof(SDN.Manufacturing.ManufacturingModule);

            this.ModuleCatalog.AddModule(new ModuleInfo()
            {
                ModuleName         = moduleCType3.Name,
                ModuleType         = moduleCType3.AssemblyQualifiedName,
                InitializationMode = InitializationMode.OnDemand
            });

            Type moduleCType4 = typeof(SDN.Settings.SettingsModule
                                       );

            this.ModuleCatalog.AddModule(new ModuleInfo()
            {
                ModuleName         = moduleCType4.Name,
                ModuleType         = moduleCType4.AssemblyQualifiedName,
                InitializationMode = InitializationMode.OnDemand
            });
        }
Ejemplo n.º 41
0
        protected override IModuleCatalog CreateModuleCatalog()
        {
            try
            {
                var catalog = new ModuleCatalog();
                catalog.AddModule(typeof(MainModule));

                return(catalog);
            }
            catch (Exception ex)
            {
                Logging.WriteErrorLog(ex);

                return(null);
            }
        }
        protected override void ConfigureModuleCatalog()
        {
            ModuleCatalog.AddModule(
                new ModuleInfo()
            {
                ModuleName = typeof(AudioControlModule).Name,
                ModuleType = typeof(AudioControlModule).AssemblyQualifiedName
            });

            ModuleCatalog.AddModule(
                new ModuleInfo()
            {
                ModuleName = typeof(VisualizerModule).Name,
                ModuleType = typeof(VisualizerModule).AssemblyQualifiedName
            });
        }
Ejemplo n.º 43
0
        protected override void ConfigureModuleCatalog()
        {
            Type toolbarModuleType = typeof(ToolbarModule);

            ModuleCatalog.AddModule(new ModuleInfo()
            {
                ModuleName         = toolbarModuleType.Name,
                ModuleType         = toolbarModuleType.AssemblyQualifiedName,
                InitializationMode = InitializationMode.WhenAvailable
            });

            Type entityGridModuleType = typeof(EntityGridModule);

            ModuleCatalog.AddModule(new ModuleInfo()
            {
                ModuleName         = entityGridModuleType.Name,
                ModuleType         = entityGridModuleType.AssemblyQualifiedName,
                InitializationMode = InitializationMode.WhenAvailable
            });

            Type statusBarModuleType = typeof(StatusBarModule);

            ModuleCatalog.AddModule(new ModuleInfo()
            {
                ModuleName         = statusBarModuleType.Name,
                ModuleType         = statusBarModuleType.AssemblyQualifiedName,
                InitializationMode = InitializationMode.WhenAvailable
            });

            //Type dataServiceModuleType = typeof(DataServiceModule);
            //ModuleCatalog.AddModule(new ModuleInfo()
            //{
            //    ModuleName = dataServiceModuleType.Name,
            //    ModuleType = dataServiceModuleType.AssemblyQualifiedName,
            //    InitializationMode = InitializationMode.WhenAvailable
            //});

            Type akkaDataServiceModuleType = typeof(AkkaDataServiceModule);

            ModuleCatalog.AddModule(new ModuleInfo()
            {
                ModuleName         = akkaDataServiceModuleType.Name,
                ModuleType         = akkaDataServiceModuleType.AssemblyQualifiedName,
                InitializationMode = InitializationMode.WhenAvailable
            });
        }
Ejemplo n.º 44
0
 public void BadModuleThrowsException()
 {
     var catalog = new ModuleCatalog();
     catalog.AddModule<BadModule>();
     var containerMock = ContainerMock.CreateMock();
     var initializer = new ModuleInitializer(containerMock.Object);
     var manager = new ModuleManager(initializer, catalog);
     manager.LoadModuleCompleted += OnModuleLoaded;
     void OnModuleLoaded(object sender, LoadModuleCompletedEventArgs args)
     {
         Assert.Equal(nameof(BadModule), args.ModuleInfo.ModuleName);
         Assert.NotNull(args.Error);
         Assert.Equal(nameof(BadModule.RegisterTypes), args.Error.Message);
         manager.LoadModuleCompleted -= OnModuleLoaded;
     }
     var ex = Record.Exception(() => manager.LoadModule(nameof(BadModule)));
 }
Ejemplo n.º 45
0
        protected override void ConfigureModuleCatalog()
        {
            Type DashboardModuleType = typeof(DashboardModule);

            ModuleCatalog.AddModule(new ModuleInfo(DashboardModuleType.Name, DashboardModuleType.AssemblyQualifiedName));


            ConfigurationModuleCatalog configurationCatalog = new ConfigurationModuleCatalog();

            ((AggregateModuleCatalog)ModuleCatalog).AddCatalog(configurationCatalog);

            // ModuleCatalog moduleCatalog = (ModuleCatalog)this.ModuleCatalog;
            // moduleCatalog.AddModule(typeof(MonitoringModule));
            //// moduleCatalog.AddModule(typeof(VideoMonitoringModule));
            // moduleCatalog.AddModule(typeof(DataAnaysisModule));
            //// moduleCatalog.AddModule(typeof(DashboardModule));
        }
        protected override void ConfigureModuleCatalog()
        {
            base.ConfigureModuleCatalog();
            ModuleCatalog moduleCatalog = (ModuleCatalog)this.ModuleCatalog;

            moduleCatalog.AddModule(typeof(ModuleAModule));


            //Type moduleAType = typeof(ModuleAModule);
            //ModuleCatalog.AddModule(new ModuleInfo()
            //{
            //    ModuleName = moduleAType.Name,
            //    ModuleType = moduleAType.AssemblyQualifiedName,
            //    InitializationMode = InitializationMode.OnDemand

            //});
        }
Ejemplo n.º 47
0
 protected override IModuleCatalog CreateModuleCatalog()
 {
     var version = AssemblyExtensions.ParseVersionNumber(typeof(Bootstrapper).Assembly).ToString();
     var moduleCatalog = new ModuleCatalog();
     moduleCatalog.AddModule
     (
         new ModuleInfo
         {
             InitializationMode = InitializationMode.WhenAvailable,
             Ref = "file://ModuleOne.dll",
             ModuleName = "ModuleOne",
             ModuleType = string.Format("ModuleOne.ModuleOne, ModuleOne, Version={0}, Culture=neutral, " +
                                         "PublicKeyToken=null", version)
         }
     );
     return moduleCatalog;
 }
Ejemplo n.º 48
0
        protected override void ConfigureModuleCatalog()
        {
            base.ConfigureModuleCatalog();
            ModuleCatalog moduleCatalog = (ModuleCatalog)ModuleCatalog;

            moduleCatalog.AddModule(typeof(ServiceModule));
            moduleCatalog.AddModule(typeof(AccountsModule));
            moduleCatalog.AddModule(typeof(StoreModule));
            moduleCatalog.AddModule(typeof(ClientsModule));
            moduleCatalog.AddModule(typeof(SuppliersModule));
            moduleCatalog.AddModule(typeof(ReportsModule));
        }
Ejemplo n.º 49
0
        protected override IModuleCatalog GetModuleCatalog()
        {
            var catalog = new ModuleCatalog();

            catalog
            .AddModule(typeof(ToolsModule))
            .AddModule(typeof(UserModule))
            .AddModule(typeof(PokerHandModule), typeof(UserModule).Name)
            .AddModule(typeof(DatabaseSetupModule), typeof(UserModule).Name)
            .AddModule(typeof(PokerHandParsersModule), typeof(PokerHandModule).Name, typeof(UserModule).Name)
            .AddModule(typeof(RepositoryModule), typeof(PokerHandParsersModule).Name, typeof(PokerHandModule).Name, typeof(UserModule).Name)
            .AddModule(typeof(StatisticsModule), typeof(RepositoryModule).Name, typeof(PokerHandModule).Name, typeof(UserModule).Name)
            .AddModule(typeof(LiveTrackerModuleMock), typeof(StatisticsModule).Name, typeof(RepositoryModule).Name, typeof(PokerHandModule).Name, typeof(UserModule).Name);

            // AddAvailablePluginsTo(catalog);

            return(catalog);
        }
Ejemplo n.º 50
0
        protected override void ConfigureModuleCatalog()
        {
            base.ConfigureModuleCatalog();

            ModuleCatalog catalog = (ModuleCatalog)ModuleCatalog;

            catalog.AddModule(typeof(FindTextModule));


            //Type findTextModuleType = typeof(FindTextModule);
            ////Type settingsModuleType = typeof(SettingsModule);

            //ModuleCatalog.AddModule(new ModuleInfo() {
            //    ModuleName = findTextModuleType.Name,
            //    ModuleType = findTextModuleType.AssemblyQualifiedName,
            //    InitializationMode = InitializationMode.WhenAvailable
            //});
        }
Ejemplo n.º 51
0
        protected override IModuleCatalog CreateModuleCatalog()
        {
            var version       = AssemblyExtensions.ParseVersionNumber(typeof(Bootstrapper).Assembly).ToString();
            var moduleCatalog = new ModuleCatalog();

            moduleCatalog.AddModule
            (
                new ModuleInfo
            {
                InitializationMode = InitializationMode.WhenAvailable,
                Ref        = "file://ModuleOne.dll",
                ModuleName = "ModuleOne",
                ModuleType = string.Format("ModuleOne.ModuleOne, ModuleOne, Version={0}, Culture=neutral, " +
                                           "PublicKeyToken=null", version)
            }
            );
            return(moduleCatalog);
        }
Ejemplo n.º 52
0
        protected override IModuleCatalog CreateModuleCatalog()
        {
            var catalog = new ModuleCatalog();

            catalog.AddModule(typeof(MenuModule));
            catalog.AddModule(typeof(SettingsModule));
            catalog.AddModule(typeof(ManifestsModule));
            catalog.AddModule(typeof(TestResultsModule));
            catalog.AddModule(typeof(TestCollectionsModule));
            catalog.AddModule(typeof(CommandHelpModule));

            return catalog;
        }
Ejemplo n.º 53
0
        protected override IModuleCatalog CreateModuleCatalog()
        {
            var moduleCatalog = new ModuleCatalog();

            moduleCatalog.AddModule(new ModuleInfo
            {
                InitializationMode = InitializationMode.OnDemand,
                Ref = "CommonService.xap",
                ModuleName = ModuleNames.CommonService,
                ModuleType =
                    "UniCloud.Presentation.CommonService.CommonServiceModule, UniCloud.Presentation.CommonService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            });

            moduleCatalog.AddModule(new ModuleInfo
            {
                InitializationMode = InitializationMode.OnDemand,
                Ref = "BaseManagement.xap",
                ModuleName = ModuleNames.BaseManagement,
                ModuleType =
                    "UniCloud.Presentation.BaseManagement.BaseManagementModule, UniCloud.Presentation.BaseManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            });

            moduleCatalog.AddModule(new ModuleInfo
            {
                InitializationMode = InitializationMode.OnDemand,
                Ref = "AircraftConfig.xap",
                ModuleName = ModuleNames.AircraftConfig,
                ModuleType =
                    "UniCloud.Presentation.AircraftConfig.AircraftConfigModule, UniCloud.Presentation.AircraftConfig, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            });

            moduleCatalog.AddModule(new ModuleInfo
            {
                InitializationMode = InitializationMode.OnDemand,
                Ref = "FlightLog.xap",
                ModuleName = ModuleNames.FlightLog,
                ModuleType =
                    "UniCloud.Presentation.FlightLog.FlightLogModule, UniCloud.Presentation.FlightLog, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            });

            moduleCatalog.AddModule(new ModuleInfo
            {
                InitializationMode = InitializationMode.OnDemand,
                Ref = "FleetPlan.xap",
                ModuleName = ModuleNames.FleetPlan,
                ModuleType =
                    "UniCloud.Presentation.FleetPlan.FleetPlanModule, UniCloud.Presentation.FleetPlan, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            });

            moduleCatalog.AddModule(new ModuleInfo
            {
                InitializationMode = InitializationMode.OnDemand,
                Ref = "Purchase.xap",
                ModuleName = ModuleNames.Purchase,
                ModuleType =
                    "UniCloud.Presentation.Purchase.PurchaseModule, UniCloud.Presentation.Purchase, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            });

            moduleCatalog.AddModule(new ModuleInfo
            {
                InitializationMode = InitializationMode.OnDemand,
                Ref = "Payment.xap",
                ModuleName = ModuleNames.Payment,
                ModuleType =
                    "UniCloud.Presentation.Payment.PaymentModule, UniCloud.Presentation.Payment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            });

            moduleCatalog.AddModule(new ModuleInfo
            {
                InitializationMode = InitializationMode.OnDemand,
                Ref = "Project.xap",
                ModuleName = ModuleNames.Project,
                ModuleType =
                    "UniCloud.Presentation.Project.ProjectModule, UniCloud.Presentation.Project, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            });

            moduleCatalog.AddModule(new ModuleInfo
            {
                InitializationMode = InitializationMode.OnDemand,
                Ref = "Portal.xap",
                ModuleName = ModuleNames.Portal,
                ModuleType =
                    "UniCloud.Presentation.Portal.PortalModule, UniCloud.Presentation.Portal, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            });

            moduleCatalog.AddModule(new ModuleInfo
            {
                InitializationMode = InitializationMode.OnDemand,
                Ref = "Part.xap",
                ModuleName = ModuleNames.Part,
                ModuleType =
                    "UniCloud.Presentation.Part.PartModule, UniCloud.Presentation.Part, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            });

            return moduleCatalog;
        }
Ejemplo n.º 54
0
        public void CanAddModule1()
        {
            ModuleCatalog catalog = new ModuleCatalog();

            catalog.AddModule("Module", "ModuleType", InitializationMode.OnDemand, "DependsOn1", "DependsOn2");

            Assert.AreEqual(1, catalog.Modules.Count());
            Assert.AreEqual("Module", catalog.Modules.First().ModuleName);
            Assert.AreEqual("ModuleType", catalog.Modules.First().ModuleType);
            Assert.AreEqual(InitializationMode.OnDemand, catalog.Modules.First().InitializationMode);
            Assert.AreEqual(2, catalog.Modules.First().DependsOn.Count);
            Assert.AreEqual("DependsOn1", catalog.Modules.First().DependsOn[0]);
            Assert.AreEqual("DependsOn2", catalog.Modules.First().DependsOn[1]);

        }
Ejemplo n.º 55
0
        public void CanAddModule4()
        {
            ModuleCatalog catalog = new ModuleCatalog();

            catalog.AddModule(typeof(MockModule), "DependsOn1", "DependsOn2");

            Assert.AreEqual(1, catalog.Modules.Count());
            Assert.AreEqual("MockModule", catalog.Modules.First().ModuleName);
            Assert.AreEqual(typeof(MockModule).AssemblyQualifiedName, catalog.Modules.First().ModuleType);
            Assert.AreEqual(InitializationMode.WhenAvailable, catalog.Modules.First().InitializationMode);
            Assert.AreEqual(2, catalog.Modules.First().DependsOn.Count);
            Assert.AreEqual("DependsOn1", catalog.Modules.First().DependsOn[0]);
            Assert.AreEqual("DependsOn2", catalog.Modules.First().DependsOn[1]);

        }
Ejemplo n.º 56
0
        public void ShouldReturnInCorrectRetrieveOrderWhenCompletingListWithDependencies()
        {
            // A <- B <- C <- D,    C <- X
            var moduleA = CreateModuleInfo("A");
            var moduleB = CreateModuleInfo("B", "A");
            var moduleC = CreateModuleInfo("C", "B");
            var moduleD = CreateModuleInfo("D", "C");
            var moduleX = CreateModuleInfo("X", "C");

            var moduleCatalog = new ModuleCatalog();
            // Add the modules in random order
            moduleCatalog.AddModule(moduleB);
            moduleCatalog.AddModule(moduleA);
            moduleCatalog.AddModule(moduleD);
            moduleCatalog.AddModule(moduleX);
            moduleCatalog.AddModule(moduleC);

            var dependantModules = moduleCatalog.CompleteListWithDependencies(new[] { moduleD, moduleX }).ToList();

            Assert.AreEqual(5, dependantModules.Count);
            Assert.IsTrue(dependantModules.IndexOf(moduleA) < dependantModules.IndexOf(moduleB));
            Assert.IsTrue(dependantModules.IndexOf(moduleB) < dependantModules.IndexOf(moduleC));
            Assert.IsTrue(dependantModules.IndexOf(moduleC) < dependantModules.IndexOf(moduleD));
            Assert.IsTrue(dependantModules.IndexOf(moduleC) < dependantModules.IndexOf(moduleX));
        }
Ejemplo n.º 57
0
        public void StartupModuleDependentOnAnOnDemandModuleThrows()
        {
            var catalog = new ModuleCatalog();
            var moduleOnDemand = CreateModuleInfo("ModuleA");
            moduleOnDemand.InitializationMode = InitializationMode.OnDemand;
            catalog.AddModule(moduleOnDemand);
            catalog.AddModule(CreateModuleInfo("ModuleB", "ModuleA"));

            try
            {
                catalog.Validate();
            }
            catch (Exception ex)
            {
                Assert.IsInstanceOfType(ex, typeof(ModularityException));
                Assert.AreEqual("ModuleB", ((ModularityException)ex).ModuleName);

                return;
            }

            Assert.Fail("Exception not thrown.");
        }
Ejemplo n.º 58
0
        public void LooseModuleIfDependentOnModuleInGroupThrows()
        {
            var catalog = new ModuleCatalog();
            catalog.Items.Add(new ModuleInfoGroup() { CreateModuleInfo("ModuleA") });
            catalog.AddModule(CreateModuleInfo("ModuleB", "ModuleA"));

            try
            {
                catalog.Validate();
            }
            catch (Exception ex)
            {
                Assert.IsInstanceOfType(ex, typeof(ModularityException));
                Assert.AreEqual("ModuleB", ((ModularityException)ex).ModuleName);

                return;
            }

            Assert.Fail("Exception not thrown.");
        }
Ejemplo n.º 59
0
        public void ShouldAggregateGroupsAndLooseModuleInfos()
        {
            var catalog = new ModuleCatalog();
            ModuleInfo moduleInfo1 = new ModuleInfo();
            ModuleInfo moduleInfo2 = new ModuleInfo();
            ModuleInfo moduleInfo3 = new ModuleInfo();

            catalog.Items.Add(new ModuleInfoGroup() { moduleInfo1 });
            catalog.Items.Add(new ModuleInfoGroup() { moduleInfo2 });
            catalog.AddModule(moduleInfo3);

            Assert.AreEqual(3, catalog.Modules.Count());
            Assert.IsTrue(catalog.Modules.Contains(moduleInfo1));
            Assert.IsTrue(catalog.Modules.Contains(moduleInfo2));
            Assert.IsTrue(catalog.Modules.Contains(moduleInfo3));
        }
Ejemplo n.º 60
0
        public void CanAddModules()
        {
            var catalog = new ModuleCatalog();

            catalog.AddModule(typeof(MockModule));

            Assert.AreEqual(1, catalog.Modules.Count());
            Assert.AreEqual("MockModule", catalog.Modules.First().ModuleName);
        }