示例#1
0
        } /* LocateClassTreeNode */

        private void ClassTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (e == null)
            {
                return;
            }

            if (updateRunning)
            {
                ClassTree.SelectedNode = LocateClassTreeNode(selectedClass.Name, ClassTree.Nodes);
                return;
            }

            if (ChangesMade())
            {
                DialogResult dr = MessageBox.Show("Do you want to loose changes that were made ?", "Changes Made", MessageBoxButtons.YesNo);
                if (dr == DialogResult.No)
                {
                    ClassTree.SelectedNode = LocateClassTreeNode(selectedClass.Name, ClassTree.Nodes);
                    return;
                }
            }

            origParent            = null;
            addingNewClass        = false;
            deletingExistingClass = false;
            String className = e.Node.Text;

            selectedClass = classes.LookUpByName(className);
            if (selectedClass == null)
            {
                MergeCheckBox.Enabled = false;
                DeleteButton.Enabled  = false;
                UpdateButton.Enabled  = false;
                return;
            }

            origParent = selectedClass.Parent;

            EnableAllFields();

            if (selectedClass.Parent == null)
            {
                MergeCheckBox.Enabled = false;
                DeleteButton.Enabled  = false;
                UpdateButton.Enabled  = false;
            }

            PopulateClassMaintenancePanel(selectedClass);
        } /* ClassTree_AfterSelect */