Exemple #1
0
 public WindowMain()
 {
     InitializeComponent();
     ServiceControls.CreateServiceControls(CanvasTree);
     ServiceListener.AddListener(Note.Get());
     PrepareMenuIcons(TreeType.CommonBST, false);
 }
        /*******************************************************************************************/
        /*******************************************************************************************/

        public void DestroyTree()
        {
            if (tree != null)
            {
                Canvas canvas = ServiceControls.GetInstance().Canvas;
                canvas.Children.Clear();
                Model.Destroy();
                Selection.Destroy();
                tree = null;
            }
        }
        /*******************************************************************************************/
        /*******************************************************************************************/

        private void ShowTree()
        {
            Model model = Model.Get();

            model.ModelTree(tree);

            Canvas canvas = ServiceControls.GetInstance().Canvas;

            PrepareCanvas(canvas, model);
            new Painter().DrawTree(tree.Root, canvas);
        }
        private void Step(Action <Tree> action)
        {
            action(tree);

            if (tree.Root is null)
            {
                Canvas canvas = ServiceControls.GetInstance().Canvas;
                canvas.Children.Clear();
                return;
            }
            ShowTree();
        }
Exemple #5
0
 public static void CreateServiceControls(Canvas canvas)
 {
     serviceControls = new ServiceControls(canvas);
 }