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

BtnLoadListClick() private method

get and display all the contact list
private BtnLoadListClick ( object sender, EventArgs e ) : void
sender object sender
e System.EventArgs e
return void
        private void BtnLoadListClick(object sender, EventArgs e)
        {
            //clean up the response and request areas
            FrmMain.RequestString = string.Empty;
            FrmMain.ResponseString = string.Empty;

            _contactList.Clear();

            try
            {
                string strRequest;
                string strResponse;

                Cursor.Current = Cursors.WaitCursor;

                _contactList = OperationsComponent.GetContactLists(CredentialsDetails, out strRequest, out strResponse);

                Cursor.Current = Cursors.Default;

                FrmMain.RequestString = strRequest;
                FrmMain.ResponseString = strResponse;

                SetListBox();

                //activate the delete button if the list count is greater than 0
                //this will always be true since we can't delete the default list
                if (_contactList.Count > 0)
                {
                    BtnRemoveList.Enabled = true;
                }
                BtnAddList.Enabled = true;
                BtnShowContactInList.Enabled = true;

            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, Resources.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            Cursor.Current = Cursors.Default;
        }