/// <summary> /// Tries to create a manipulator for the given node. This method /// also registers the property changed event handler. /// </summary> /// <param name="node">The input node</param> /// <returns>true if manipulator was created</returns> private bool TryCreateManipulator(NodeModel node) { //Can't create manipulator for node that is not selected. if (!node.IsSelected) { return(false); } //Make sure we register property changed notification if node is selected. if (trackedNodeGuids.Add(node.GUID)) { node.PropertyChanged += OnNodePropertyChanged; } //No manipulator for frozen node or node in state of error if (node.IsFrozen || node.IsInErrorState) { return(false); } //If the node already has a manipulator, then skip creating new one. if (manipulatorDaemon.HasNodeManipulator(node)) { return(false); } //Finally let the Daemon create the manipulator. manipulatorDaemon.CreateManipulator(node, this); return(true); }
private void CreateManipulators(IEnumerable <NodeModel> nodes) { foreach (var nm in nodes) { if (nm.IsFrozen || !nm.IsSelected) { continue; } manipulatorDaemon.CreateManipulator(nm, this); } }