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(); }
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; } } }
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; } } }