private void restartApp() { // reset forms FormPosts?.Dispose(); FormPosts = null; FormCheckIns?.Dispose(); FormCheckIns = null; FormMusic?.Dispose(); FormMusic = null; buttonAbout.PerformClick(); // reset labels labelFirstName.Text = "First Name: N/A"; labelLastName.Text = "Last Name: N/A"; labelGender.Text = "Gender: N/A"; labelBirthDay.Text = "BirthDay: N/A"; labelCity.Text = "City: N/A"; labelEmail.Text = "Email: N/A"; // reset profile picture this.circularPictureBoxProfile.Image = Properties.Resources.Facebook_no_profile_picture; // reset friends list listBoxFriends.Invoke(new Action(() => listBoxFriends.Items.Clear())); // logout this.buttonLogin.Visible = true; LoginManager = null; checkBoxRememberMe.Checked = false; checkBoxRememberMe.Enabled = false; }
private void buttonMusicPanelExecute(object i_Sender, EventArgs i_E) { if (isUserLogged()) { handleControlsPanelSwitch(); if (FormMusic == null) { FormMusic = new FormMusic(DataManager) { Dock = DockStyle.Fill, TopLevel = false, TopMost = true }; } this.panelForm.Controls.Add(FormMusic); FormMusic.Show(); this.labelPanelTitle.Text = ((Button)i_Sender).Text; } }
private void handleControlsPanelSwitch() { FormMusic?.RestoreWebBrowser(); this.panelForm.Controls.Clear(); }