private void lnkSolvAgentRef_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { if (GlobalVariables.SolvCatalystMaster == null) { MessageBox.Show("Master table not yet loaded. Please try later.", GlobalVariables.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { using (frmSolAgentReference frmSolAgent = new frmSolAgentReference()) { if (frmSolAgent.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (!String.IsNullOrEmpty(frmSolAgent.IupacName.Trim()) && !String.IsNullOrEmpty(frmSolAgent.MoleFile.Trim())) { txtName.Text = frmSolAgent.IupacName; ChemRenditor.MolfileString = frmSolAgent.MoleFile; } } } } } catch (Exception ex) { ErrorHandling.WriteErrorLog(ex.ToString()); } }
private void solventAgentsMasterToolStripMenuItem_Click(object sender, EventArgs e) { try { frmSolAgentReference solvAgents = null; FormCollection frmColl = Application.OpenForms; bool blFrmOpen = false; foreach (Form objfrm in frmColl) { if (objfrm.Name.ToUpper() == "FRMSOLAGENTREFERENCE") { solvAgents = (frmSolAgentReference)objfrm; blFrmOpen = true; solvAgents.Show(); solvAgents.WindowState = FormWindowState.Maximized; } } if (!blFrmOpen) { solvAgents = new frmSolAgentReference(); solvAgents.MdiParent = this; solvAgents.Show(); solvAgents.WindowState = FormWindowState.Maximized; } } catch (Exception ex) { ErrorHandling.WriteErrorLog(ex.ToString()); } }