private void Form1_Closing(object sender, EventArgs e) { // stop the timers _aTimer.Enabled = false; _thisForm = null; if (m_Connection != null) { m_Connection.Dispose(); } m_Connection = null; }
public AccountHandler(SessionConnectionLU0 connection) { if (connection == null) { throw new ArgumentNullException("connection"); } // attach the connection to a new Session _session = new SessionLU0(connection); // if we should trace, we need a fixed width font FontFamily fontFamily = new FontFamily("Courier New"); m_FixedFont = new Font(fontFamily, 10, FontStyle.Regular, GraphicsUnit.Pixel); }
private void SetOpeningState() { // set the last button pressed on the main menu _lastPressed = null; DisableEverything(); try { // connect to the host if not already done so if (m_Connection == null) { // use a SessionLU0 to do the connection SessionLU0 session = new SessionLU0(); string connectionString = "LogicalUnitName=" + this.InputLUNameBox.Text.Trim().ToUpperInvariant() + ";DestinationLogicalUnitName=" + this.InputCICSNameBox.Text.Trim().ToUpperInvariant(); session.Connect(connectionString, SessionLU0InitType.INITSELF); // get the connection from the session m_Connection = session.Connection; // and disconnect this session session.Disconnect(); } if (_accountHandler != null) { _accountHandler.FinishWithAccount(); } // start up the animation of the card eInternalState = eStates.eReadingCard; _cardReadingState = 0; HandleReadingCard(); } catch (Exception ex) { string messageToShow = ex.Message; if (ex.InnerException != null) { messageToShow += Environment.NewLine + ex.InnerException.Message; } MessageBox.Show(messageToShow); } }