private void ConnectionPointOutPresenterOnSelected() { _selectedConnectionPointPresenter = _connectionPointOutPresenter; if (ConnectionPointSelected != null) { ConnectionPointSelected.Invoke(this, _connectionPointOutPresenter); } }
private void ConnectionPointInPresenterOnUnSelected() { _selectedConnectionPointPresenter = null; if (ConnectionPointUnSelected != null) { ConnectionPointUnSelected.Invoke(this, _connectionPointInPresenter); } }
public static NodePresenter Create(Vector2 position) { var nodeView = new SetBackgroundNodeView(LocalizationStrings.SetBackgroundNode, position); var connectionPointInPresenter = new ConnectionPointPresenter(new ConnectionPointView(nodeView, ConnectionPointType.In)); var connectionPointOutPresenter = new ConnectionPointPresenter(new ConnectionPointView(nodeView, ConnectionPointType.Out)); var nodeData = new SetBackgroundNodeData(); var nodePresenter = new SetBackgroundNodePresenter(nodeView, nodeData, connectionPointInPresenter, connectionPointOutPresenter); return(nodePresenter); }
protected NodePresenter(INodeView nodeView, NodeData nodeData, ConnectionPointPresenter connectionPointInPresenter, ConnectionPointPresenter connectionPointOutPresenter) { _nodeView = nodeView; _nodeData = nodeData; _connectionPointInPresenter = connectionPointInPresenter; _connectionPointOutPresenter = connectionPointOutPresenter; _nodeView.MouseClicked += OnMouseClicked; _connectionPointInPresenter.Selected += ConnectionPointInPresenterOnSelected; _connectionPointOutPresenter.Selected += ConnectionPointOutPresenterOnSelected; _connectionPointInPresenter.UnSelected += ConnectionPointInPresenterOnUnSelected; _connectionPointOutPresenter.UnSelected += ConnectionPointOutPresenterOnUnSelected; Id = Guid.NewGuid(); }
public QuestionNodePresenter(INodeView nodeView, NodeData nodeData, ConnectionPointPresenter connectionPointInPresenter, ConnectionPointPresenter connectionPointOutPresenter) : base(nodeView, nodeData, connectionPointInPresenter, connectionPointOutPresenter) { _nodeView = nodeView; var parameter = new NodeParameter("Texture Path") { IsClickable = true }; _nodeParametersPanel = new NodeParametersPanel(new List <NodeParameter> { parameter }); }
public SetBackgroundNodePresenter(SetBackgroundNodeView nodeView, NodeData nodeData, ConnectionPointPresenter connectionPointInPresenter, ConnectionPointPresenter connectionPointOutPresenter) : base(nodeView, nodeData, connectionPointInPresenter, connectionPointOutPresenter) { _nodeView = nodeView; var parameter = new NodeParameter("Texture Path") { IsClickable = true }; parameter.Clicked += OnTextureParameterClicked; _nodeParametersPanel = new NodeParametersPanel(new List <NodeParameter> { parameter }); }
private void OnConnectionPointSelected(NodePresenter nodePresenter, ConnectionPointPresenter connectionPointPresenter) { if (_selectedNodePresenter != null && _selectedNodePresenter.Id != nodePresenter.Id) { var selectedConnectionPointPresenter = _selectedPointPresenter; var connectionBetweenNodes = new ConnectionPresenter(new ConnectionView(), new ConnectionModel()) { ConnectionPointFrom = selectedConnectionPointPresenter, ConnectionPointTo = connectionPointPresenter }; _selectedNodePresenter.AddNextNode(nodePresenter); _connectionPresenters.Add(connectionBetweenNodes); _selectedNodePresenter = null; return; } _selectedNodePresenter = nodePresenter; _selectedPointPresenter = connectionPointPresenter; }
private void OnConnectionPointUnSelected(NodePresenter nodePresenter, ConnectionPointPresenter connectionPointPresenter) { _selectedNodePresenter = null; _selectedPointPresenter = null; }