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);
        }
示例#2
0
        public void LoadPage(IModulePage page)
        {
            var item = new NavigationItem(null, null, page.GetType(), null);

            item.Page = page;
            var info = page.PageInfo;

            _navigationService.NavigateToItem(item, false);
        }
示例#3
0
        public void LoadInner(IModulePage page)
        {
            var panel = page as ContainerControl;

            if (panel == null)
            {
                return;
            }

            panel.Dock = DockStyle.Fill;
            scMain.Panel2.Controls.Clear();
            scMain.Panel2.Controls.Add(panel);
        }
示例#4
0
        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);
        }
 public static bool IsHomepage(
     IModulePage modulePage
     )
 {
     return(false);
 }