public frmLogin(ref OCL.Oyster OSystem) { // // Required for Windows Form Designer support // InitializeComponent(); m_oyster = OSystem; // // TODO: Add any constructor code after InitializeComponent call // }
private void tmrGeneral_Tick(object sender, System.EventArgs e) { tmrGeneral.Enabled = false; frmRecordOptions frm = new frmRecordOptions(); if (!frm.CurrentRecordOptions.HasBeenSaved) { if (frm.ShowDialog(this) != System.Windows.Forms.DialogResult.OK) { DialogResult = System.Windows.Forms.DialogResult.Cancel; //this.Close(); return; } } TryOysterAgain:{} this.Update(); Application.DoEvents(); try { this.Text = "Connecting to Oyster..."; m_oyster = new OCL.Oyster(frm.CurrentRecordOptions.DefaultOysterAddress,OCL.Oyster.DefaultOysterNetworkPort); } catch(Exception Err) { this.Text = "Unable to connect to Oyster"; if(Err.Message == "Unable to connect to Oyster Server") { if(System.Windows.Forms.MessageBox.Show("Try Again?","Could not connect to Oyster Server",MessageBoxButtons.RetryCancel)== DialogResult.Retry) { goto TryOysterAgain; } this.DialogResult = System.Windows.Forms.DialogResult.Abort; //this.Close(); return; } } if (m_oyster == null) { this.Text = "Unable to connect to Oyster"; if(System.Windows.Forms.MessageBox.Show("Try Again?","Could not connect to Oyster Server",MessageBoxButtons.RetryCancel)== DialogResult.Retry) { goto TryOysterAgain; } DialogResult = System.Windows.Forms.DialogResult.Abort; //this.Close(); return; } this.Text = "Login to Oyster System"; this.Enabled = true; this.txtUserName.Focus(); }