示例#1
0
        private void CreateProfileButton_Click(object sender, RoutedEventArgs e)
        {
            // Verify password
            bool result = MyGlobals.GlobalMethods.VerifyPasswordQuality(NewProfilePasswordTextBox.Text);

            if (!result)
            {
                // 5 second warning
                Thread thread = new Thread(ShowInvalidPasswordWarning);
                thread.Start();

                NewProfilePasswordTextBox.Focus();
            }
            else
            {
                if (EditingExistingProfile)
                {
                    // Updates passwords ownerships
                    App.PassDB.UpdatePasswordsByField("profile", NewProfileUserTextBox.Text, MyGlobals.CurrentProfile.Username);
                    // Removes older version of profile
                    App.PassDB.RemoveProfile(MyGlobals.TemporaryItem.Username);

                    // Restores globals
                    MyGlobals.TemporaryItem  = Items.Empty();
                    MyGlobals.CurrentProfile = null;

                    EditingExistingProfile = false;
                }

                AddProfile();

                // Pop up
                Thread thread = new Thread(MainWindow.ShowPopUp);
                thread.Start(App.NewWindow);

                nav.Navigate(new System.Uri("LoginPage.xaml", UriKind.RelativeOrAbsolute));
            }
        }
示例#2
0
 private void GeneratePassword_Click(object sender, RoutedEventArgs e)
 {
     TemporaryRandomPassword = MyGlobals.GlobalMethods.GenerateRandPassword();
     NewProfilePasswordTextBox.Focus();
 }