Пример #1
0
        private void mnuNodesReload_Click(object sender, EventArgs e)
        {
            IBaseNode currentNode = TreeNodeAsBaseNode(tvDecisionTree.SelectedNode);

            if (currentNode != null)
            {
                IDecisionTree tree = currentNode.Tree;

                bool CanDelete = false;

                if (tree.IsDirty)
                {
                    CanDelete = App.GetFloatingForm(eFloatReason.NotSet, new ucConfirmDropModel(tree)).ShowDialog() == DialogResult.OK;
                }
                else
                {
                    CanDelete = true;
                }

                if (CanDelete)
                {
                    int           treeIndex = Trees.IndexOf(tree);
                    IDecisionTree newTree   = App.NewDescisionTree();
                    newTree.Load(tree.Persistence.Clone(), tree.FullPath);

                    Trees.Remove(tree);
                    Trees.Insert(treeIndex, newTree);
                    RefreshTree(tvDecisionTree);

                    App.SelectedTree = Trees.Count > 0 ? Trees[0] : null;

                    App.SelectedObject = Trees.Count > 0 ? Trees[0] : null;
                }
            }
        }
Пример #2
0
 public static void DebugTrees()
 {
     CDebug.WriteLine("===============", true);
     CDebug.WriteLine("Detected trees");
     foreach (CTree t in Trees)
     {
         CDebug.WriteLine(Trees.IndexOf(t).ToString("00") + ": " + t);
         if (Trees.IndexOf(t) > MAX_DEBUG_COUNT)
         {
             CDebug.WriteLine("too much to debug...total = " + Trees.Count);
             return;
         }
     }
     CDebug.WriteLine("\n===============\n");
 }