private async void ChatForm_FormClosed(object sender, FormClosedEventArgs e) { Timer.Enabled = false; Timer.Stop(); await ServerCommunicator.Logout(Username); File.SetAttributes(Configurator.ChatLogPath, FileAttributes.Hidden | FileAttributes.ReadOnly); File.SetAttributes(Configurator.PendingMessagesPath, FileAttributes.Hidden | FileAttributes.ReadOnly); }
private async void ButtonLogOut_Click(object sender, EventArgs e) { Timer.Enabled = false; Timer.Stop(); await ServerCommunicator.Logout(Username); for (int i = 0; i < listViewOthers.Items.Count; i++) { listViewOthers.Items.RemoveAt(i); i--; } for (int i = 0; i < tabControlConversations.TabPages.Count; i++) { tabControlConversations.TabPages.RemoveAt(i); i--; } Hide(); LoginForm.Show(); }