Example #1
0
        public void AddFieldToNode(Node node, Type type)
        {
            var newField = new Field(Haikunator.Random(), type.FullName);

            node.Fields.Add(newField);
            SaveGraph(GraphData);
            SendNotification(NodeFieldAdded, new Tuple <Node, Field>(node, newField));
        }
Example #2
0
        public void AddNewNode(Vector2 mousePosition)
        {
            var newNode = new Node
            {
                Position = new Rect(mousePosition, new Vector2(Node.DefaultWidth, Node.DefaultHeight)),
                Name     = Haikunator.Random()
            };

            GraphData.Nodes.Add(newNode);
            SaveGraph(GraphData);

            SendNotification(NodeAdded, newNode);
        }