Beispiel #1
0
        /// <summary>
        /// Called when the user has finished dragging out the new connection.
        /// </summary>
        public void ConnectionDragCompleted(ConnectionViewModel newConnection, ConnectorViewModel connectorDraggedOut, ConnectorViewModel connectorDraggedOver)
        {
            if (connectorDraggedOver == null ||
                connectorDraggedOut.IsChoice == connectorDraggedOver.IsChoice ||
                connectorDraggedOut.ParentNode == connectorDraggedOver.ParentNode)
            {
                //
                // The connection was unsuccessful.
                // Maybe the user dragged it out and dropped it in empty space.
                //
                DlgModel.Network.Connections.Remove(newConnection);
                return;
            }

            //
            // Finalize the connection by attaching it to the connector
            // that the user dropped the connection on.
            //
            newConnection.DestConnector = connectorDraggedOver;
        }
Beispiel #2
0
 public SetChoiceDestUndoableCommand(ConnectorViewModel destConnector, ConnectionViewModel connection, DialogueChoice choice)
 {
     _destConnector = destConnector;
     _connection    = connection;
     _choice        = choice;
 }
Beispiel #3
0
 public void Undo()
 {
     _dialogue.RemoveChoice(_connector.DialogueChoice);
     _outgoingConnectors.Remove(_connector);
     _connector = null;
 }
Beispiel #4
0
 public SetConnectorContentUndoableCommand(string newContent, ConnectorViewModel connector)
 {
     _newContent = newContent;
     _connector  = connector;
     _oldContent = _connector.Content;
 }
Beispiel #5
0
 public void Execute()
 {
     _connector = new ConnectorViewModel(_cmdExec, _dialogue.AddChoice(_dialogueEntry, _content), _node);
     _outgoingConnectors.Add(_connector);
 }