public void Select <TNode>(Node <TNode> node) where TNode : class { _node = null; node.Accept(this); if (_node == null) { PropertyNode <T, TProperty> propertyNode = _configurator.Property <T, TProperty>(Property); var parentNode = node as Node <T>; if (parentNode == null) { throw new ArgumentException("Expected propertyNode, but was " + node.GetType().Name); } parentNode.AddActivation(propertyNode); _node = propertyNode; } _next.Select(_node); }
public void Select <TNode>(Node <TNode> node) where TNode : class { _node = null; node.Accept(this); if (_node == null) { EqualNode <T, TProperty> equalNode = _configurator.Equal <T, TProperty>(); var parentNode = node as Node <Token <T, TProperty> >; if (parentNode == null) { throw new ArgumentException("Expected " + typeof(T).Tokens() + ", but was " + typeof(TNode).Tokens()); } parentNode.AddActivation(equalNode); _node = equalNode; } _next.Select(_node[_value]); }
public void Select <TNode>(Node <TNode> node) where TNode : class { _node = null; node.Accept(this); if (_node == null) { EachNode <T, TProperty, TElement> eachNode = CreateNode(); var parentNode = node as Node <Token <T, TProperty> >; if (parentNode == null) { throw new ArgumentException("Expected " + typeof(T).Tokens() + ", but was " + typeof(TNode).Tokens()); } parentNode.AddActivation(eachNode); _node = eachNode; } _next.Select(_node); }
public void Select() { AlphaNode <T> alphaNode = _configurator.GetAlphaNode <T>(); _next.Select(alphaNode); }
/// <summary> /// Handles the MouseLeftButtonUp event /// </summary> /// <param name="args">The arguments for the event</param> public void NodeMouseLeftButtonUpEventHandler(NodeViewModelMouseEventArgs <MouseButtonEventArgs> args) { // Only allow node manipulation if we are not in pan mode if (!isPanMode) { NodeSelector nodeSelector = GraphManager.Instance.DefaultGraphComponentsInstance.NodeSelector; // Check if we were dragging the node if (isNodeDragging) { // Turn off node dragging isNodeDragging = false; dragTargetNode = null; } else { // Check if any nodes are currently selected if (nodeSelector.AreAnyNodesSelected) { // Check if Control is pressed if ((Keyboard.Modifiers & ModifierKeys.Alt) > 0) { nodeSelector.InvertSelection(); } else { // Check if multiple nodes are selected if (nodeSelector.AreMultipleNodesSelected) { // Check if target node is already selected if (nodeSelector.SelectedNodes.Contains(args.NodeViewModel)) { // Check if Control is pressed if ((Keyboard.Modifiers & ModifierKeys.Control) > 0) { nodeSelector.Unselect(args.NodeViewModel); return; } else { nodeSelector.UnselectAll(); } } else // Target node is not selected { // Check if Control is pressed if ((Keyboard.Modifiers & ModifierKeys.Control) == 0) { nodeSelector.UnselectAll(); } } } else // Only one node is selected { // Check if the target node is already selected if (nodeSelector.SelectedNode.Equals(args.NodeViewModel)) { nodeSelector.Unselect(nodeSelector.SelectedNode); return; } else // Target node is not selected { // Check if Control is pressed if ((Keyboard.Modifiers & ModifierKeys.Control) == 0) { nodeSelector.Unselect(nodeSelector.SelectedNode); } } } } } // Set the SELECTED state of the clicked node nodeSelector.Select(args.NodeViewModel); } } }