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

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

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

            model.ModelTree(tree);

            Canvas canvas = ServiceControls.GetInstance().Canvas;

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

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