Exemplo n.º 1
0
        private void ShowActivePaneHelp()
        {
            string topic = null;

            if (_panesView.SelectedNode != null)
            {
                AbstractOptionsPane optionsPane = _panesView.SelectedNode.Tag as AbstractOptionsPane;
                if (optionsPane != null)
                {
                    topic = optionsPane.GetHelpKeyword();
                }
            }

            if (topic == null)
            {
                topic = "/reference/options_dialog.html";
            }

            Help.ShowHelp(this, Core.UIManager.HelpFileName, topic);
        }
Exemplo n.º 2
0
 private bool ApplyChanges()
 {
     lock ( _optionsGroups )
     {
         // save cursor
         Cursor currentCursor = Cursor.Current;
         Cursor.Current = Cursors.WaitCursor;
         try
         {
             foreach (TreeNode rootNode in _panesView.Nodes)
             {
                 UIManager.OptionsGroupDescriptor desc =
                     (UIManager.OptionsGroupDescriptor)_optionsGroups[rootNode.Text];
                 if (desc != null)
                 {
                     _errorMessage    = null;
                     _controlToSelect = null;
                     foreach (TreeNode paneNode in rootNode.Nodes)
                     {
                         AbstractOptionsPane pane = paneNode.Tag as AbstractOptionsPane;
                         if (pane != null)
                         {
                             if (!pane.IsValid(ref _errorMessage, ref _controlToSelect))
                             {
                                 if (_panesView.SelectedNode == paneNode)
                                 {
                                     DisplayError();
                                 }
                                 else
                                 {
                                     _panesView.SelectedNode = paneNode;
                                 }
                                 return(false);
                             }
                         }
                     }
                     foreach (TreeNode paneNode in rootNode.Nodes)
                     {
                         AbstractOptionsPane pane = paneNode.Tag as AbstractOptionsPane;
                         if (pane != null)
                         {
                             pane.OK();
                             _needRestart = _needRestart || pane.NeedRestart;
                             HashMap.Entry E = desc._optionsListeners.GetEntry(paneNode.Text);
                             if (E != null)
                             {
                                 ArrayList handlers = (ArrayList)E.Value;
                                 for (int i = 0; i < handlers.Count; i++)
                                 {
                                     EventHandler handler = (EventHandler)handlers[i];
                                     handler(this, new EventArgs());
                                 }
                             }
                             // extract options pane creator from map and replace pane with it
                             paneNode.Tag = desc._optionsPanes[paneNode.Text];
                         }
                     }
                 }
             }
         }
         finally
         {
             Cursor.Current = currentCursor;
         }
     }
     return(true);
 }