示例#1
0
        public void OnOK(object sender, EventArgs e)
        {
            // Call |Save| on each preferences panel...
            IEnumerator panels = mPanels.Values.GetEnumerator();

            while (panels.MoveNext())
            {
                PrefPanel currPanel = panels.Current as PrefPanel;
                currPanel.Save();
            }

            // ... then flush preferences to disk for safe keepin'.
            // XXX not just yet.
            // mPrefs.FlushUserPreferences();
        }
示例#2
0
        public void OnTreeSelect(Object sender, TreeViewEventArgs e)
        {
            TreeNode  selectedNode = e.Node;
            String    panelID      = mNodes[selectedNode.GetHashCode()] as String;
            PrefPanel newPanel     = mPanels[panelID] as PrefPanel;

            if (mCurrentPanel != null)
            {
                mCurrentPanel.Visible = false;
            }
            if (newPanel != null)
            {
                newPanel.Visible = true;
                mCurrentPanel    = newPanel;
            }
            else
            {
                if (selectedNode.FirstNode != null)
                {
                    TreeView treeview = sender as TreeView;
                    treeview.SelectedNode = selectedNode.FirstNode;
                }
            }
        }
示例#3
0
文件: PrefsDialog.cs 项目: nfan/Jaxer
 public void OnTreeSelect(Object sender, TreeViewEventArgs e)
 {
     TreeNode selectedNode = e.Node;
       String panelID = mNodes[selectedNode.GetHashCode()] as String;
       PrefPanel newPanel = mPanels[panelID] as PrefPanel;
       if (mCurrentPanel != null)
     mCurrentPanel.Visible = false;
       if (newPanel != null) {
     newPanel.Visible = true;
     mCurrentPanel = newPanel;
       }
       else {
     if (selectedNode.FirstNode != null) {
       TreeView treeview = sender as TreeView;
       treeview.SelectedNode = selectedNode.FirstNode;
     }
       }
 }