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)); }
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); }