Exemple #1
0
        private void InitializeUI()
        {
            SuspendLayout();

            IManagementUIService uiService = (IManagementUIService)GetService(typeof(IManagementUIService));

            Font titleFont = (Font)uiService.Styles["PageHeaderTitleFont"];
            Padding = new Padding(0, 12, 0, 0);

            //
            // All page item labels
            //
            _versionNameLabel = new Label();
            _versionNameLabel.Text = Resources.PHPPageVersion;
            _versionValueLabel = new Label();

            _executableNameLabel = new Label();
            _executableNameLabel.Text = Resources.PHPPageExecutable;
            _executableValueLabel = new Label();

            _handlerMappingNameLabel = new Label();
            _handlerMappingNameLabel.Text = Resources.PHPPageHandlerMapping;
            _handlerMappingValueLabel = new LinkLabel();
            _handlerMappingValueLabel.LinkClicked += new LinkLabelLinkClickedEventHandler(OnHandlerMappingValueLabelLinkClicked);

            _configPathNameLabel = new Label();
            _configPathNameLabel.Text = Resources.PHPPageConfigurationFile;
            _configPathValueLabel = new LinkLabel();
            _configPathValueLabel.LinkClicked += new LinkLabelLinkClickedEventHandler(OnPathLinkLabelLinkClicked);

            _errorLogNameLabel = new Label();
            _errorLogNameLabel.Text = Resources.PHPPageErrorLog;
            _errorLogValueLabel = new LinkLabel();
            _errorLogValueLabel.LinkClicked += new LinkLabelLinkClickedEventHandler(OnPathLinkLabelLinkClicked);

            _enabledExtLabel = new Label();
            _installedExtLabel = new Label();

            //
            // PHPSetup
            //
            _phpSetupItem = new PHPPageItemControl();
            _phpSetupItem.RightToLeftLayout = this.RightToLeftLayout;
            _phpSetupItem.RightToLeft = this.RightToLeft;
            _phpSetupItem.TitleClick += new LinkLabelLinkClickedEventHandler(OnPHPSetupItemTitleClick);
            _phpSetupItem.Title = Resources.PHPSetupItemTitle;
            _phpSetupItem.TitleFont = titleFont;
            _phpSetupItem.Image = Resources.PHPSetup32;

            _phpSetupItem.AddInfoRow(_versionNameLabel, _versionValueLabel);
            _phpSetupItem.AddInfoRow(_executableNameLabel, _executableValueLabel);
            _phpSetupItem.AddInfoRow(_handlerMappingNameLabel, _handlerMappingValueLabel);
            _phpSetupItem.AddTask(OnPHPSetupItemClick,
                                    Resources.PHPSetupItemRegisterPHPTask,
                                    Resources.PHPSetupItemChangeVersionTask,
                                    Resources.PHPSetupItemCheckPHPInfoTask);

            Controls.Add(_phpSetupItem);
            //
            // PHP Settings
            //
            _phpSettingsItem = new PHPPageItemControl();
            _phpSettingsItem.RightToLeftLayout = this.RightToLeftLayout;
            _phpSettingsItem.RightToLeft = this.RightToLeft;
            _phpSettingsItem.TitleClick += new LinkLabelLinkClickedEventHandler(OnPHPSettingsItemTitleClick);
            _phpSettingsItem.Title = Resources.PHPSettingsItemTitle;
            _phpSettingsItem.TitleFont = titleFont;
            _phpSettingsItem.Image = Resources.PHPSettings32;

            _phpSettingsItem.AddInfoRow(_configPathNameLabel, _configPathValueLabel);
            _phpSettingsItem.AddInfoRow(_errorLogNameLabel, _errorLogValueLabel);
            if (Connection.IsUserServerAdministrator)
            {
                _phpSettingsItem.AddTask(OnPHPSettingsItemClick,
                                        Resources.PHPSettingsItemErrorReportingTask,
                                        Resources.PHPSettingsItemLimitsTask,
                                        Resources.PHPSettingsItemAllSettingsTask);
            }
            else
            {
                _phpSettingsItem.AddTask(OnPHPSettingsItemClick,
                                        Resources.PHPSettingsItemReadOnlyErrorReportingTask,
                                        Resources.PHPSettingsItemReadOnlyLimitsTask,
                                        Resources.PHPSettingsItemReadOnlyAllSettingsTask);
            }

            Controls.Add(_phpSettingsItem);
            //
            // PHP Extensions
            //
            _phpExtensionItem = new PHPPageItemControl();
            _phpExtensionItem.RightToLeftLayout = this.RightToLeftLayout;
            _phpExtensionItem.RightToLeft = this.RightToLeft;
            _phpExtensionItem.TitleClick += new LinkLabelLinkClickedEventHandler(OnPHPExtensionItemTitleClick);
            _phpExtensionItem.Title = Resources.PHPExtensionsItemTitle;
            _phpExtensionItem.TitleFont = titleFont;
            _phpExtensionItem.Image = Resources.PHPExtensions32;

            _phpExtensionItem.AddSpanRow(_enabledExtLabel);
            _phpExtensionItem.AddSpanRow(_installedExtLabel);
            if (Connection.IsUserServerAdministrator)
            {
                _phpExtensionItem.AddTask(OnPHPExtensionItemClick,
                                        Resources.PHPExtensionItemEnableTask, Resources.PHPExtensionItemAddTask);
            }
            else
            {
                _phpExtensionItem.AddTask(OnPHPExtensionItemClick,
                                        Resources.PHPExtensionItemReadOnlyEnableTask);
            }

            Controls.Add(_phpExtensionItem);

            // Update the information summaries for each PHPPageItemControl
            Refresh();

            ResumeLayout(true);
        }
Exemple #2
0
        private void InitializeUI()
        {
            SuspendLayout();

            var uiService = (IManagementUIService)GetService(typeof(IManagementUIService));

            var titleFont = (Font)uiService.Styles["PageHeaderTitleFont"];

            Padding = new Padding(0, 12, 0, 0);

            //
            // All page item labels
            //
            _versionNameLabel = new Label {
                Text = Resources.PHPPageVersion
            };
            _versionValueLabel = new Label();

            _executableNameLabel = new Label {
                Text = Resources.PHPPageExecutable
            };
            _executableValueLabel = new Label();

            _handlerMappingNameLabel = new Label {
                Text = Resources.PHPPageHandlerMapping
            };
            _handlerMappingValueLabel              = new LinkLabel();
            _handlerMappingValueLabel.LinkClicked += OnHandlerMappingValueLabelLinkClicked;

            _configPathNameLabel = new Label {
                Text = Resources.PHPPageConfigurationFile
            };
            _configPathValueLabel              = new LinkLabel();
            _configPathValueLabel.LinkClicked += OnPathLinkLabelLinkClicked;

            _errorLogNameLabel = new Label {
                Text = Resources.PHPPageErrorLog
            };
            _errorLogValueLabel              = new LinkLabel();
            _errorLogValueLabel.LinkClicked += OnPathLinkLabelLinkClicked;

            _enabledExtLabel   = new Label();
            _installedExtLabel = new Label();

            //
            // PHPSetup
            //
            _phpSetupItem = new PHPPageItemControl
            {
                RightToLeftLayout = RightToLeftLayout,
                RightToLeft       = RightToLeft
            };
            _phpSetupItem.TitleClick += OnPHPSetupItemTitleClick;
            _phpSetupItem.Title       = Resources.PHPSetupItemTitle;
            _phpSetupItem.TitleFont   = titleFont;
            _phpSetupItem.Image       = Resources.PHPSetup32;

            _phpSetupItem.AddInfoRow(_versionNameLabel, _versionValueLabel);
            _phpSetupItem.AddInfoRow(_executableNameLabel, _executableValueLabel);
            _phpSetupItem.AddInfoRow(_handlerMappingNameLabel, _handlerMappingValueLabel);
            _phpSetupItem.AddTask(OnPHPSetupItemClick,
                                  Resources.PHPSetupItemRegisterPHPTask,
                                  Resources.PHPSetupItemChangeVersionTask,
                                  Resources.PHPSetupItemCheckPHPInfoTask);

            Controls.Add(_phpSetupItem);
            //
            // PHP Settings
            //
            _phpSettingsItem = new PHPPageItemControl
            {
                RightToLeftLayout = RightToLeftLayout,
                RightToLeft       = RightToLeft
            };
            _phpSettingsItem.TitleClick += OnPHPSettingsItemTitleClick;
            _phpSettingsItem.Title       = Resources.PHPSettingsItemTitle;
            _phpSettingsItem.TitleFont   = titleFont;
            _phpSettingsItem.Image       = Resources.PHPSettings32;

            _phpSettingsItem.AddInfoRow(_configPathNameLabel, _configPathValueLabel);
            _phpSettingsItem.AddInfoRow(_errorLogNameLabel, _errorLogValueLabel);
            if (Connection.IsUserServerAdministrator)
            {
                _phpSettingsItem.AddTask(OnPHPSettingsItemClick,
                                         Resources.PHPSettingsItemErrorReportingTask,
                                         Resources.PHPSettingsItemLimitsTask,
                                         Resources.PHPSettingsItemAllSettingsTask);
            }
            else
            {
                _phpSettingsItem.AddTask(OnPHPSettingsItemClick,
                                         Resources.PHPSettingsItemReadOnlyErrorReportingTask,
                                         Resources.PHPSettingsItemReadOnlyLimitsTask,
                                         Resources.PHPSettingsItemReadOnlyAllSettingsTask);
            }

            Controls.Add(_phpSettingsItem);
            //
            // PHP Extensions
            //
            _phpExtensionItem = new PHPPageItemControl
            {
                RightToLeftLayout = RightToLeftLayout,
                RightToLeft       = RightToLeft
            };
            _phpExtensionItem.TitleClick += OnPHPExtensionItemTitleClick;
            _phpExtensionItem.Title       = Resources.PHPExtensionsItemTitle;
            _phpExtensionItem.TitleFont   = titleFont;
            _phpExtensionItem.Image       = Resources.PHPExtensions32;

            _phpExtensionItem.AddSpanRow(_enabledExtLabel);
            _phpExtensionItem.AddSpanRow(_installedExtLabel);
            if (Connection.IsUserServerAdministrator)
            {
                _phpExtensionItem.AddTask(OnPHPExtensionItemClick,
                                          Resources.PHPExtensionItemEnableTask, Resources.PHPExtensionItemAddTask);
            }
            else
            {
                _phpExtensionItem.AddTask(OnPHPExtensionItemClick,
                                          Resources.PHPExtensionItemReadOnlyEnableTask);
            }

            Controls.Add(_phpExtensionItem);

            // Update the information summaries for each PHPPageItemControl
            Refresh();

            ResumeLayout(true);
        }