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(); }
public static void CreateServiceControls(Canvas canvas) { serviceControls = new ServiceControls(canvas); }