CSharpTutor.FrmMain.RestartToolStripMenuItemClick C# (CSharp) Method

RestartToolStripMenuItemClick() private method

Reset all the data and give the user the opportunity to start over the guide
private RestartToolStripMenuItemClick ( object sender, EventArgs e ) : void
sender object sender
e System.EventArgs e
return void
        private void RestartToolStripMenuItemClick(object sender, EventArgs e)
        {
            splitContainer.Visible = false;
            restartToolStripMenuItem.Enabled = false;
            getStartedToolStripMenuItem.Enabled = true;
            richTextBoxRequest.Text = string.Empty;
            richTextBoxResponse.Text = string.Empty;

            //clean up the loging control
            if (_login != null)
            {
                _login.DoLogin -= LoginDoLogin;
                _login.Parent = null;
                _login = null;
            }

            //clean up the contact list control
            if (_contactListControl != null)
            {
                _contactListControl.DoShowContactsInList -= ContactListControlDoShowContactsInList;
                _contactListControl.Parent = null;
                _contactListControl = null;
            }

            //clean up the contact list control
            if (_contactControl != null)
            {
                _contactControl.DoBack -= ContactControlDoBack;
                _contactControl.Parent = null;
                _contactControl = null;
            }
        }