Beispiel #1
0
        private AppCommand _CreateShowCommand()
        {
            AppCommand showCommand = new AppCommand("WebserverConfigure", "Configure");
            showCommand.Click += (sender, e) => {
                using (Settings cs = new Settings(_data)) {
                    cs.SettingsChanged += cs_SettingsChanged;
                    if (cs.ShowDialog() == System.Windows.Forms.DialogResult.OK) {

                        _data.HttpPort = cs.Port;
                        _data.IsEnabled = cs.WebServerEnabled;

                    }
                    _SetServerEnableState(_data.IsEnabled, _data.HttpPort);
                }
            };

            return showCommand;
        }
Beispiel #2
0
        private void _AddApplicationMenu()
        {
            if (_AppSupportsCommands())
            {
                AppCommand toolsMenu = _GetToolsMenu();
                AppCommand showCommand = new AppCommand(MENU_ID_ROOT, "Web Server");

                showCommand.Click += (sender, e) =>
                {
                    using (Settings cs = new Settings(_data))
                    {
                        cs.SettingsChanged += cs_SettingsChanged;
                        if (cs.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {

                            _data.HttpPort = cs.Port;
                            _data.IsEnabled = cs.WebServerEnabled;

                        }
                        _SetServerEnableState(_data.IsEnabled, _data.HttpPort);
                    }
                };

                toolsMenu.Add(showCommand);
            }
        }