private void newToolStripMenuItem1_Click(object sender, EventArgs e) { CreateProtocolDialog cpd = new CreateProtocolDialog(); cpd.StartPosition = FormStartPosition.CenterParent; if (DialogResult.OK.Equals(cpd.ShowDialog(this))) { try { opcMockProject.AddProtocol(cpd.OpcMockProtocol); } catch (DuplicateProtocolNameException exProtocolName) { MessageBox.Show(this, exProtocolName.Message + "\n" + exProtocolName.ProtocolName, "Protocol exists", MessageBoxButtons.OK, MessageBoxIcon.Error); } } cpd.Dispose(); }
private void newToolStripMenuItem1_Click(object sender, EventArgs e) { CreateProtocolDialog cpd = new CreateProtocolDialog(); cpd.StartPosition = FormStartPosition.CenterParent; if (DialogResult.OK.Equals(cpd.ShowDialog(this))) { try { opcMockProject.AddProtocol(cpd.OpcMockProtocol); } catch (DuplicateProtocolNameException exProtocolName) { MessageBox.Show(this, exProtocolName.Message + "\n" + exProtocolName.ProtocolName, "Protocol exists", MessageBoxButtons.OK, MessageBoxIcon.Error); } } cpd.Dispose(); }