Ejemplo n.º 1
1
 /// <summary>
 /// Initializes a new instance of the NameField class with the specified id, parent node and
 /// references. 
 /// </summary>
 /// <param name="id">The id of the new NameField.</param>
 /// <param name="elementManager">A reference to the ElementManager.</param>
 /// <param name="model">A reference to the Model.</param>
 /// <param name="parentNode">A reference to the parent node of the NameField.</param>
 public NameField(String id, ElementManager elementManager, IModel model, IVisualNode parentNode)
 {
     _id = id;
     _elementManager = elementManager;
     _model = model;
     _parentNode = parentNode;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a new slot
        /// </summary>
        /// <param name="gc">Owning graph controller</param>
        /// <param name="type">Input/Output slot</param>
        /// <param name="firstOwner">Node where there slot resides</param>
        internal Slot(IGraphController gc, SlotType type, IVisualNode firstOwner)
        {
            if (gc == null || firstOwner == null)
                throw new ArgumentNullException();

            this.graphController = gc as GraphController;
            Validity.Assert(this.graphController != null);
            IdGenerator idGenerator = this.graphController.GetIdGenerator();

            this.slotType = type;
            this.version = Slot.Version.Current;
            this.slotId = idGenerator.GetNextId(ComponentType.Slot);
            this.slotState = SlotStates.Visible;
            this.owners.Add(firstOwner.NodeId);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Removes the specified VisualNode from the visual presentation of the petrinet.
 /// </summary>
 /// <param name="node">The VisualNode to remove.</param>
 public void RemoveNode(IVisualNode node)
 {
     VisualNodes.Remove(node.Id);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Adds the specified VisualNode to the visual presentation of the petrinet.
 /// </summary>
 /// <param name="node">A reference to the VisualNode that is to be added.</param>
 public void AddNode(IVisualNode node)
 {
     VisualNodes.Add(node.Id, node);
 }
        internal void AddVisualNode(IVisualNode node)
        {
            if (null == node)
                throw new ArgumentNullException("node");

            this.nodeCollection.Add(node.NodeId, node);
        }
Ejemplo n.º 6
0
 internal void AppendToAddedNodes(IVisualNode node)
 {
     if (null != node)
     {
         if (null == addedNodes)
             addedNodes = new List<IVisualNode>();
         addedNodes.Add(node);
     }
 }
Ejemplo n.º 7
0
 internal DraggedNode(IVisualNode node)
 {
     this.node = node;
     this.DeltaX = 0;
     this.DeltaY = 0;
 }
Ejemplo n.º 8
0
        public void Defect_IDE_1767()
        {
            // Steps are ,e

            string commands = @"
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                CreateCodeBlockNode|d:15329.0|d:15185.0|s:
                BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                EndNodeEdit|u:0x10000001|s:a=1+1;|b:True
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                CreateCodeBlockNode|d:15472.4|d:15277.8|s:
                BeginNodeEdit|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                EndNodeEdit|u:0x10000002|s:1+1;\na+b;\n\n1..20;|b:True
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                CreateCodeBlockNode|d:15509.2|d:15167.4|s:
                BeginNodeEdit|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Text
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                EndNodeEdit|u:0x10000003|s:b=10;|b:True
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None";

            GraphController controller = new GraphController(null);
            bool            result     = controller.RunCommands(commands);

            Assert.AreEqual(true, result);

            IVisualNode node01 = controller.GetVisualNode(0x10000001); // Code Block Node
            IVisualNode node02 = controller.GetVisualNode(0x10000002); // Code Block Node

            ISlot outputSlot01 = controller.GetSlot(0x30000001);

            Assert.IsNotNull(outputSlot01);
            ISlot inputSlot01 = controller.GetSlot(0x30000002);

            Assert.IsNotNull(inputSlot01);
            uint[] connecting01 = outputSlot01.ConnectingSlots;
            Assert.IsNotNull(connecting01);
            Assert.IsTrue(connecting01.Contains((uint)0x30000002));

            ISlot outputSlot02 = controller.GetSlot(0x30000001);

            Assert.IsNotNull(outputSlot02);
            ISlot inputSlot02 = controller.GetSlot(0x30000002);

            Assert.IsNotNull(inputSlot02);
            uint[] connecting02 = outputSlot02.ConnectingSlots;
            Assert.IsNotNull(connecting02);
            Assert.IsTrue(connecting02.Contains((uint)0x30000002));

            Assert.IsEmpty(node01.ErrorMessage);
            Assert.IsEmpty(node02.ErrorMessage);

            Assert.AreEqual(3, controller.GetVisualNodes().Count);
        }
Ejemplo n.º 9
0
 internal void AppendToModifiedNodes(IVisualNode node)
 {
     if (null != node)
     {
         if (null == modifiedNodes)
             modifiedNodes = new List<IVisualNode>();
         modifiedNodes.Add(node);
     }
 }
Ejemplo n.º 10
0
        internal void SelectEdges(IVisualNode activatedNode)
        {
            uint[] inputs = activatedNode.GetInputSlots();
            uint[] outputs = activatedNode.GetOutputSlots();

            if (null != inputs)
                selectedSlots.AddRange(inputs);
            if (null != outputs)
                selectedSlots.AddRange(outputs);

            foreach (uint slotId in selectedSlots)
            {
                foreach (VisualEdge visualEdge in edgeCollection.Values)
                {
                    if (visualEdge.Selected)
                        continue;

                    if ((visualEdge.StartSlotId == slotId) || (visualEdge.EndSlotId == slotId))
                    {
                        visualEdge.Selected = true;
                        visualEdge.Compose();
                    }
                }
            }
        }
Ejemplo n.º 11
0
        internal void DeleteEdgesConnectTo(IVisualNode visualNode)
        {
            uint[] inputs = visualNode.GetInputSlots();
            uint[] outputs = visualNode.GetOutputSlots();

            List<VisualEdge> edgesToRemove = new List<VisualEdge>();

            if (inputs != null)
            {
                foreach (uint slotId in inputs)
                {
                    foreach (VisualEdge visualEdge in edgeCollection.Values)
                    {
                        if (visualEdge.EndSlotId == slotId || visualEdge.StartSlotId == slotId)
                            edgesToRemove.Add(visualEdge);
                    }
                }
            }
            if (outputs != null)
            {
                foreach (uint slotId in outputs)
                {
                    foreach (VisualEdge visualEdge in edgeCollection.Values)
                    {
                        if (visualEdge.EndSlotId == slotId || visualEdge.StartSlotId == slotId)
                            edgesToRemove.Add(visualEdge);
                    }
                }
            }

            foreach (VisualEdge edgeToDelete in edgesToRemove)
                DeleteEdge(edgeToDelete);
        }
Ejemplo n.º 12
0
 public HitTestEnumerable(IVisualNode root, Func <IVisual, bool>?filter, Point point, IVisualNode sceneRoot)
 {
     _root      = root;
     _filter    = filter;
     _point     = point;
     _sceneRoot = sceneRoot;
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Removes a child from the <see cref="Children"/> collection.
 /// </summary>
 /// <param name="child">The child to remove.</param>
 public void RemoveChild(IVisualNode child)
 {
     EnsureChildrenCreated();
     _children.Remove(child);
     child.Dispose();
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Adds a child to the <see cref="Children"/> collection.
 /// </summary>
 /// <param name="child">The child to add.</param>
 public void AddChild(IVisualNode child)
 {
     EnsureChildrenCreated();
     _children.Add(child);
 }
Ejemplo n.º 15
0
        public void Defect_IDE_2079()
        {
            // Steps are mentioned in defect: http://adsk-oss.myjetbrains.com/youtrack/issue/IDE-2079

            string commands = @"
            MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            CreateCodeBlockNode|d:15359.0|d:15209.0|s:
            BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
            MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
            EndNodeEdit|u:0x10000001|s:1|b:True
            MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            CreateFunctionNode|d:15299.0|d:15287.5|s:ProtoGeometry.dll|s:Point.ByCoordinates|s:double,double,double
            MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None
            BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None|d:15314.0|d:15296.0
            EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None|d:15514.0|d:15221.0
            MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:0|e:System.Windows.Input.ModifierKeys,None
            MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
            BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:15381.0|d:15210.0
            EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputLabel|i:0|e:System.Windows.Input.ModifierKeys,None|d:15459.0|d:15190.0
            MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputLabel|i:0|e:System.Windows.Input.ModifierKeys,None
            MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
            BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:15379.0|d:15210.0
            EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputLabel|i:1|e:System.Windows.Input.ModifierKeys,None|d:15463.0|d:15217.0
            MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputLabel|i:1|e:System.Windows.Input.ModifierKeys,None
            MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None
            BeginDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,OutputSlot|i:0|e:System.Windows.Input.ModifierKeys,None|d:15381.0|d:15209.0
            EndDrag|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputLabel|i:2|e:System.Windows.Input.ModifierKeys,None|d:15467.0|d:15229.0
            MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,InputLabel|i:2|e:System.Windows.Input.ModifierKeys,None
            MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            CreateCodeBlockNode|d:15621.0|d:15225.0|s:
            BeginNodeEdit|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Text
            MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000003|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
            EndNodeEdit|u:0x10000003|s:a=Var2|b:True
            MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            CreateCodeBlockNode|d:15615.0|d:15363.0|s:
            BeginNodeEdit|u:0x10000004|e:DesignScriptStudio.Graph.Core.NodePart,Text
            MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000004|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
            EndNodeEdit|u:0x10000004|s:a.Z=1;|b:True
            MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
            ";

            GraphController controller = new GraphController(null);
            bool            result     = controller.RunCommands(commands);

            Assert.AreEqual(true, result);

            IVisualNode node01 = controller.GetVisualNode(0x10000004);// Code Block Node with Property value.


            Assert.AreEqual("'a' is already defined.\n", node01.ErrorMessage);
            //Assert.IsNull(node01.PreviewValue);
        }
Ejemplo n.º 16
0
 internal void AppendToRemovedNodes(IVisualNode node)
 {
     if (null != node)
     {
         if (null == removedNodes)
             removedNodes = new List<IVisualNode>();
         removedNodes.Add(node);
     }
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Add a new owner
 /// </summary>
 /// <param name="newOwner"></param>
 private void PushOwner(IVisualNode newOwner)
 {
     owners.Add(newOwner.NodeId);
 }
Ejemplo n.º 18
0
        public void Defect_IDE_1416()
        {
            // Error should come on the recent edited node and not for others.
            // Create a Code Block node with value "a=1;"
            // create another Code Block node with value "a=2;".
            // After above step error message will popup for second Code Block node, which is correct.
            // Now change the first Code Block node to "b=1;"
            // Now there is no error message.
            // Now again change back first Code Block node to "a=1;"
            // After above step error will popup for second Code Block node, whereas it should popup for first Code Block node.

            string commands = @"
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                CreateCodeBlockNode|d:10108.25714286|d:10592.91428571|s:
                BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,NorthWest|i:-1|e:System.Windows.Input.ModifierKeys,None
                EndNodeEdit|u:0x10000001|s:a=1;|b:True
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                CreateCodeBlockNode|d:10136.92380952|d:10671.91428571|s:
                BeginNodeEdit|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,Text
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000002|e:DesignScriptStudio.Graph.Core.NodePart,NorthWest|i:-1|e:System.Windows.Input.ModifierKeys,None
                EndNodeEdit|u:0x10000002|s:a= 2;|b:True
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None";

            GraphController controller = new GraphController(null);
            bool            result     = controller.RunCommands(commands);

            Assert.AreEqual(true, result);

            IVisualNode node01 = controller.GetVisualNode(0x10000001); // Code Block Node
            IVisualNode node02 = controller.GetVisualNode(0x10000002); // Code Block Node

            Assert.AreEqual("'a' is already defined.\n", node02.ErrorMessage);

            commands = @"
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                EndNodeEdit|u:0x10000001|s:b = 1;|b:True
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                BeginNodeEdit|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0x10000001|e:DesignScriptStudio.Graph.Core.NodePart,Text|i:-1|e:System.Windows.Input.ModifierKeys,None
                EndNodeEdit|u:0x10000001|s:a = 1;|b:True
                MouseDown|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None
                MouseUp|e:System.Windows.Input.MouseButton,Left|u:0xffffffff|e:DesignScriptStudio.Graph.Core.NodePart,None|i:-1|e:System.Windows.Input.ModifierKeys,None";

            bool result01 = controller.RunCommands(commands);

            Assert.AreEqual(true, result01);

            Assert.AreEqual("'a' is already defined.\n", node01.ErrorMessage);
        }