CSharpTutor.Controls.ContactListControl.BtnShowContactInListClick C# (CSharp) Method

BtnShowContactInListClick() private method

will load a new control on to the main window that will handle contact API calls
private BtnShowContactInListClick ( object sender, EventArgs e ) : void
sender object sender
e System.EventArgs e
return void
        private void BtnShowContactInListClick(object sender, EventArgs e)
        {
            try
            {
                if (LstLists.SelectedItem != null)
                {
                    //set the current selected list to be used in a future action
                    FrmMain.CurrentSelectedList = (ContactListDetails) LstLists.SelectedItem;
                    if (DoShowContactsInList != null)
                    {
                        DoShowContactsInList(this, new EventArgs());
                    }
                }
                else
                {
                    MessageBox.Show(Resources.SelectListMessage, Resources.MessageBoxTitle, MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, Resources.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }