/// <summary> /// Create new node /// </summary> /// <param name="nodeType"></param> /// <param name="name"></param> public Node CreateNode(Main.Nodes.NodeType nodeType, string name = null) { var newNode = NodesManager.CreateNode(nodeType, name); if (NodeCreated != null) { NodeCreated(newNode); } return(newNode); }
/// <summary> /// Create new node /// </summary> /// <param name="debug">Print result in console</param> NodeViewModel CreateNode(Main.Nodes.NodeType type, double left, double right, bool debug, string name = null) { NodeViewModel inst = new NodeViewModel(Scheme.CreateNode(type, name), left, right, this); Nodes.Add(inst); if (debug) { ConsViewModel.Print(string.Format("Node ({0}) added", inst.NodeModel)); } return(inst); }