private void btnAddCompanyMessage_Click(object sender, EventArgs e)
 {
     try
     {
         addCompanyMessageForm.ShowDialog();
     }
     catch (Exception)
     {
         addCompanyMessageForm = new AddMessageForm(this, MessageType.Company);
         addCompanyMessageForm.ShowDialog();
     }
 }
        private void btnEdit_Click(object sender, EventArgs e)
        {
            int index = lstMessageSummary.SelectedIndex;

            if (index < 0)
            {
                return;
            }

            MessageFormat mf = (MessageFormat)lstMessageSummary.Items[index];

            if (companyMessages.Contains(mf))
            {
                return;
            }

            addLocalMessageForm = new AddMessageForm(this, MessageType.Local, index);
            addLocalMessageForm.ShowDialog();
        }
        private void btnEdit_Click(object sender, EventArgs e)
        {
            int index = lstMessageSummary.SelectedIndex;

              if (index < 0)
                  return;

              MessageFormat mf = (MessageFormat)lstMessageSummary.Items[index];

              if (companyMessages.Contains(mf))
                  return;

              addLocalMessageForm = new AddMessageForm(this, MessageType.Local, index);
              addLocalMessageForm.ShowDialog();
        }
 private void btnAddMessage_Click(object sender, EventArgs e)
 {
     addLocalMessageForm = new AddMessageForm(this, MessageType.Local, -1);
            addLocalMessageForm.ShowDialog();
 }
 private void btnAddMessage_Click(object sender, EventArgs e)
 {
     try
        {
             addLocalMessageForm.ShowDialog();
        }
        catch (Exception)
        {
             addLocalMessageForm = new AddMessageForm(this, MessageType.Local);
             addLocalMessageForm.ShowDialog();
        }
 }