Ejemplo n.º 1
0
        public override string Process(string[] arguments)
        {
            string output = "";

            if (arguments.Length == 3)
            {
                TransformNode childNode  = TransformNode.Find(arguments[1]) as TransformNode;
                TransformNode parentNode = TransformNode.Find(arguments[2]) as TransformNode;

                if (childNode != null && parentNode != null)
                {
                    if (childNode.FindNode(parentNode.Name) == null)
                    {
                        childNode.SetParent(parentNode);
                    }
                    else
                    {
                        output = "Cannot parent a node to one of its children";
                    }
                }
                else
                {
                    output = "Parenting failed - could not find parent or child node";
                }
            }
            else
            {
                output = "You must specify two nodes";
            }

            return(output);
        }
Ejemplo n.º 2
0
        public static void Group(TransformNode node1, TransformNode node2)
        {
            TransformNode groupNode = new TransformNode("Group");

            node1.SetParent(groupNode);
            node2.SetParent(groupNode);
        }
Ejemplo n.º 3
0
        public override string Process(string[] arguments)
        {
            string output = "";

            if (arguments.Length == 2)
            {
                TransformNode node = TransformNode.Find(arguments[1]) as TransformNode;
                if (node != null)
                {
                    node.SetParent(null);
                }
                else
                {
                    output = "Could not find specified node";
                }
            }
            else
            {
                output = "You must specify a single node";
            }

            return(output);
        }