コード例 #1
0
        private bool CopyModifiersToShape(Node sourceShape, Node destinationShape)
        {
            var root           = Document.Root;
            var impactedValues = ComputeImpactedValues(sourceShape, root);

            if (impactedValues.Count != 0)
            {
                NaroMessage.Show("You should apply a list of tools without branches");
                return(false);
            }
            if (_listTools.Count == 0)
            {
                NaroMessage.Show("No tool to apply!");
                return(false);
            }

            foreach (var tool in _listTools)
            {
                var generatedTool = NodeUtils.ApplyToolOnOtherShape(Document, tool, destinationShape);
                if (!generatedTool.LastExecute)
                {
                    NaroMessage.Show("Error on generating tool chain. Quitting...");
                    return(false);
                }
                destinationShape = generatedTool.Node;
            }
            return(true);
        }
コード例 #2
0
        protected override bool ApplyFunction()
        {
            var sourceTool      = FirstShape;
            var destinationTool = SecondShape;
            var toolResult      = NodeUtils.ApplyToolOnOtherShape(Document, sourceTool, destinationTool);

            if (toolResult.LastExecute)
            {
                AddNodeToTree(toolResult.Node);
                return(true);
            }
            return(false);
        }