private void FailedConnection(FSM_EventArgs.Payload_Only e)
 {
     TWS.Disconnect();
     FireEvent(Events.Disconnected);
 }
 private void Connected(FSM_EventArgs.Payload_Only e)
 {
     TWS.Connected();
 }
 // TWS is verified to be running so is available for connection
 private void ReadyToConnect(FSM_EventArgs.Payload_Only e)
 {
 }
 private void TryConnection(FSM_EventArgs.Payload_Only e)
 {
     TWS.Connect();
 }
        // Methods for individual states. Should be private or protected to hide them since they don't need to be called directly.
        // NOTE: NAMES NEED TO MATCH STATES EXACTLY OR EXCEPTIONS WILL BE GENERATED!
        #region State Methods

        // Disconnected from TWS.
        public void NotConnected(FSM_EventArgs.Payload_Only e)
        {
            // TODO: Detect if TWS application is running. For now we will assume it is.
            FireEvent(Events.TwsRunning);
        }