public _Node GetNodeById(int id) { lock (AllNodesLock) { return(AllNodes.FirstOrDefault(n => n.Id == id)); } }
public _Node GetNodeAt(Point p) { lock (AllNodesLock) { return(AllNodes.FirstOrDefault(n => n.Visualizer.OnIt(p))); } }
public _Node GetMinimumNode() { lock (AllNodesLock) { return(AllNodes.FirstOrDefault(fn => fn.Id == AllNodes.Min(n => n.Id))); } }
public ISpecNode FindSpecNode(SpecPath path) { if (path.FullName.IsEmpty()) { return(this); } var fullName = path.FullName; return(AllNodes.FirstOrDefault(x => x.FullName == fullName)); }
public void MarkAsSelected(Module module, BackgroundWorker worker) { if (WasCancelled(worker) && SelectedNode != null) { return; } SelectedNode = AllNodes.FirstOrDefault(n => ((ModuleNode)n.Tag).Module.Equals(module)); if (WasCancelled(worker) || SelectedNode == null) { return; } EnsureVisible(SelectedNode); }
public void DisplayKeepingSelection(IEnumerable <Module> modules) { var lastSelectedDeviareNode = SelectedDeviareNode; Display(modules); var first = AllNodes.FirstOrDefault( n => ((DeviareNode)n.Tag).DeviareNodeName.Equals(lastSelectedDeviareNode.DeviareNodeName)); if (first != null) { first.IsSelected = true; } }
public void CanCopyAndPasteAllNodesOnRevit(NodeModelSearchElement searchElement) { var model = ViewModel.Model; searchElement.ProduceNode(); // puts the node into the current workspace var node = AllNodes.FirstOrDefault(); DynamoSelection.Instance.ClearSelection(); DynamoSelection.Instance.Selection.Add(node); Assert.AreEqual(1, DynamoSelection.Instance.Selection.Count); Assert.DoesNotThrow(() => model.Copy(), string.Format("Could not copy node : {0}", node.GetType())); Assert.DoesNotThrow(() => model.Paste(), string.Format("Could not paste node : {0}", node.GetType())); model.ClearCurrentWorkspace(); }