예제 #1
0
        private void SingleNodeAction(object sender, BonsaiInput.NodeContext actionType)
        {
            switch (actionType)
            {
            case BonsaiInput.NodeContext.SetAsRoot:
                Canvas.SetRoot(NodeSelection.SingleSelectedNode);
                break;

            case BonsaiInput.NodeContext.Duplicate:
                EditorNodeCreation.DuplicateSingle(Canvas, NodeSelection.SingleSelectedNode);
                break;

            case BonsaiInput.NodeContext.FormatTree:
                BonsaiNode root = NodeSelection.SingleSelectedNode;
                Formatter.PositionNodesNicely(root, root.Center);
                break;

            case BonsaiInput.NodeContext.Delete:
                RemoveSelectedNodes();
                break;

            case BonsaiInput.NodeContext.AddBreakPoint:
                SetBreakPoint(NodeSelection.SingleSelectedNode, true);
                break;

            case BonsaiInput.NodeContext.DeleteBreakPoint:
                SetBreakPoint(NodeSelection.SingleSelectedNode, false);
                break;
            }

            UpdateAbortableSelection();
        }
예제 #2
0
        private void MultiNodeAction(object sender, BonsaiInput.NodeContext actionType)
        {
            switch (actionType)
            {
            case BonsaiInput.NodeContext.DuplicateSelection:
                var duplicates = EditorNodeCreation.DuplicateMultiple(Canvas, NodeSelection.SelectedNodes);
                NodeSelection.SetMultiSelection(duplicates);
                break;

            case BonsaiInput.NodeContext.DeleteSelection:
                RemoveSelectedNodes();
                break;
            }

            UpdateAbortableSelection();
        }