public override void LoadPanels(MainForm mainForm, ServiceContainer serviceContainer, List <ModuleProvider> moduleProviders) { if (readOnly) { MessageBox.Show("Elevation is required. Please run Jexus Manager as administrator."); return; } if (ServerManager == null && _status != NodeStatus.Loaded) { return; } serviceContainer.RemoveService(typeof(IConfigurationService)); serviceContainer.RemoveService(typeof(IControlPanel)); var server = (ServerManager)Tag; var panel = new ServerPage(server); var scope = ManagementScope.Server; serviceContainer.AddService(typeof(IControlPanel), new ControlPanel()); serviceContainer.AddService(typeof(IConfigurationService), new ConfigurationService(mainForm, server.GetApplicationHostConfiguration(), scope, server, null, null, null, null, null)); var moduleDefinitions = new List <ModuleDefinition>(); var modules = new List <Module>(); foreach (var provider in moduleProviders) { if (!provider.SupportsScope(scope)) { continue; } var definition = provider.GetModuleDefinition(null); moduleDefinitions.Add(definition); var type = Type.GetType(definition.ClientModuleTypeName); if (type == null) { continue; } if (!typeof(Module).IsAssignableFrom(type)) { continue; } var module = (Module)Activator.CreateInstance(type); module.Initialize(serviceContainer, null); modules.Add(module); } IModulePage page = panel; var mainModule = new MainModule(); mainModule.Initialize(serviceContainer, null); page.Initialize(mainModule, null, null); mainForm.LoadPage(page); }
public override void LoadPanels(MainForm mainForm, ServiceContainer serviceContainer, List <ModuleProvider> moduleProviders) { if (Site.Applications.Count == 0) { return; } serviceContainer.RemoveService(typeof(IConfigurationService)); serviceContainer.RemoveService(typeof(IControlPanel)); var panel = new SitePage(Site, mainForm); var scope = ManagementScope.Site; serviceContainer.AddService(typeof(IControlPanel), new ControlPanel()); serviceContainer.AddService(typeof(IConfigurationService), new ConfigurationService(mainForm, Site.GetWebConfiguration(), scope, null, Site, Site.Applications[0], null, null, Site.Name)); foreach (var provider in moduleProviders) { if (!provider.SupportsScope(scope)) { continue; } var definition = provider.GetModuleDefinition(null); var type = Type.GetType(definition.ClientModuleTypeName); if (type == null) { continue; } if (!typeof(Module).IsAssignableFrom(type)) { continue; } var module = (Module)Activator.CreateInstance(type); module.Initialize(serviceContainer, null); } IModulePage page = panel; var mainModule = new MainModule(); mainModule.Initialize(serviceContainer, null); page.Initialize(mainModule, null, null); mainForm.LoadPage(page); }