// This opens a new window to ask user for a username
        private void setUserName()
        {
            // Opening the userNamePrompt window
            UserNamePrompt userNamePrompt = new UserNamePrompt();

            userNamePrompt.ShowDialog();
        }
Exemple #2
0
        // Delete the username and make a new one
        private void DeleteUserName(object sender, MouseButtonEventArgs e)
        {
            // We close the main window
            DBChat mainwindow = new DBChat();

            mainwindow.Close();
            // We grab the file with user name in it and delete the file
            string path = "UserNameFile.txt";

            File.Delete(path);
            // We start the userNamePrompt and get the user to input a username
            UserNamePrompt userNamePrompt = new UserNamePrompt();

            userNamePrompt.ShowDialog();
        }