Ejemplo n.º 1
0
        public MainForm(List <string> files)
        {
            InitializeComponent();

            removeToolStripMenuItem.Image  = DefaultTaskList.RemoveImage;
            removeToolStripMenuItem1.Image = DefaultTaskList.RemoveImage;
            btnRemoveFarmServer.Image      = DefaultTaskList.RemoveImage;
            toolStripMenuItem44.Image      = DefaultTaskList.RemoveImage;

            Icon = Resources.iis;
            imageList1.Images.Add(Resources.iis_16);                // 0
            imageList1.Images.Add(Resources.server_16);             // 1
            imageList1.Images.Add(Resources.application_pools_16);  // 2
            imageList1.Images.Add(Resources.sites_16);              // 3
            imageList1.Images.Add(Resources.site_16);               // 4
            imageList1.Images.Add(Resources.application_16);        // 5
            imageList1.Images.Add(Resources.physical_directory_16); // 6
            imageList1.Images.Add(Resources.virtual_directory_16);  // 7
            imageList1.Images.Add(Resources.farm_16);               // 8
            imageList1.Images.Add(Resources.farm_server_16);        // 9
            imageList1.Images.Add(Resources.servers_16);            // 10
            imageList1.Images.Add(Resources.server_disabled_16);    // 11
            imageList1.Images.Add(Resources.farm_disabled_16);      // 12
            btnAbout.Text = string.Format("About Jexus Manager {0}", Assembly.GetExecutingAssembly().GetName().Version);
            treeView1.Nodes.Add(new PlaceholderTreeNode("Start Page", 0)
            {
                ContextMenuStrip = cmsIis
            });
            if (!Helper.IsRunningOnMono())
            {
                IisExpressRoot = new PlaceholderTreeNode("IIS Express", 10)
                {
                    ContextMenuStrip = cmsIis
                };
                treeView1.Nodes.Add(IisExpressRoot);
                IisRoot = new PlaceholderTreeNode("IIS", 10)
                {
                    ContextMenuStrip = cmsIis
                };
                treeView1.Nodes.Add(IisRoot);
            }

            JexusRoot = new PlaceholderTreeNode("Jexus", 10)
            {
                ContextMenuStrip = cmsIis
            };
            treeView1.Nodes.Add(JexusRoot);

            _providers = new List <ModuleProvider>
            {
                new AspModuleProvider(),
                new AuthenticationModuleProvider(),
                new AuthorizationModuleProvider(),
                new CgiModuleProvider(),
                new CompressionModuleProvider(),
                new DefaultDocumentModuleProvider(),
                new DirectoryBrowseModuleProvider(),
                new HttpErrorsModuleProvider(),
                new TraceFailedRequestsModuleProvider(),
                new FastCgiModuleProvider(),
                new HandlersModuleProvider(),
                new HttpRedirectModuleProvider(),
                new ResponseHeadersModuleProvider(),
                new IpSecurityModuleProvider(),
                new IsapiCgiRestrictionModuleProvider(),
                new IsapiFiltersModuleProvider(),
                new LoggingModuleProvider(),
                new MimeMapModuleProvider(),
                new ModulesModuleProvider(),
                new CachingModuleProvider(),
                new RequestFilteringModuleProvider(),
                new AccessModuleProvider(),
                new CertificatesModuleProvider(),
                new RewriteModuleProvider(),
                new HttpApiModuleProvider(),
                new JexusModuleProvider()
            };

            _navigationService = new NavigationService(this);
            _navigationService.NavigationPerformed += (sender, args) =>
            {
                var item = new ExplorerNavigationHistoryItem("");
                item.Tag = args.NewItem;
                eanLocation.Navigation.AddHistory(item);
            };
            UIService         = new ManagementUIService(this);
            _serviceContainer = new ServiceContainer();
            _serviceContainer.AddService(typeof(INavigationService), _navigationService);
            _serviceContainer.AddService(typeof(IManagementUIService), UIService);

            if (files.Count == 0)
            {
                LoadIisExpress();
                LoadIis();
                LoadJexus();
            }
            else
            {
                LoadIisExpressQuick(files);
            }

            Text = PublicNativeMethods.IsProcessElevated ? string.Format("{0} (Administrator)", Text) : Text;
        }
Ejemplo n.º 2
0
        public MainForm()
        {
            InitializeComponent();

            removeToolStripMenuItem.Image  = DefaultTaskList.RemoveImage;
            removeToolStripMenuItem1.Image = DefaultTaskList.RemoveImage;
            btnRemoveFarmServer.Image      = DefaultTaskList.RemoveImage;
            toolStripMenuItem44.Image      = DefaultTaskList.RemoveImage;

            Icon = Resources.iis;
            imageList1.Images.Add(Resources.iis_16);
            imageList1.Images.Add(Resources.server_16);
            imageList1.Images.Add(Resources.application_pools_16);
            imageList1.Images.Add(Resources.sites_16);
            imageList1.Images.Add(Resources.site_16);
            imageList1.Images.Add(Resources.application_16);
            imageList1.Images.Add(Resources.physical_directory_16);
            imageList1.Images.Add(Resources.virtual_directory_16);
            imageList1.Images.Add(Resources.farm_16);
            imageList1.Images.Add(Resources.farm_server_16);
            imageList1.Images.Add(Resources.servers_16);
            btnAbout.Text = string.Format("About Jexus Manager {0}", Assembly.GetExecutingAssembly().GetName().Version);
            treeView1.Nodes.Add(new HomePageTreeNode {
                ContextMenuStrip = cmsIis
            });

            _providers = new List <ModuleProvider>
            {
                new AuthenticationModuleProvider(),
                new AuthorizationModuleProvider(),
                new CgiModuleProvider(),
                new CompressionModuleProvider(),
                new DefaultDocumentModuleProvider(),
                new DirectoryBrowseModuleProvider(),
                new FastCgiModuleProvider(),
                new HttpErrorsModuleProvider(),
                new HandlersModuleProvider(),
                new HttpRedirectModuleProvider(),
                new ResponseHeadersModuleProvider(),
                new IpSecurityModuleProvider(),
                new IsapiCgiRestrictionModuleProvider(),
                new IsapiFiltersModuleProvider(),
                new LoggingModuleProvider(),
                new MimeMapModuleProvider(),
                new ModulesModuleProvider(),
                new CachingModuleProvider(),
                new RequestFilteringModuleProvider(),
                new AccessModuleProvider(),
                new CertificatesModuleProvider(),
                new RewriteModuleProvider(),
                new HttpApiModuleProvider(),
                new JexusModuleProvider()
            };

            _navigationService = new NavigationService(this);
            _navigationService.NavigationPerformed += (sender, args) =>
            {
                var item = new ExplorerNavigationHistoryItem("");
                item.Tag = args.NewItem;
                eanLocation.Navigation.AddHistory(item);
            };
            this.UIService    = new ManagementUIService(this);
            _serviceContainer = new ServiceContainer();
            _serviceContainer.AddService(typeof(INavigationService), _navigationService);
            _serviceContainer.AddService(typeof(IManagementUIService), this.UIService);

            LoadIisExpress();
            this.LoadIis();
            this.LoadJexus();

            Text = NativeMethods.IsProcessElevated ? string.Format("{0} (Administrator)", this.Text) : Text;
        }