private void btnSubmit_Click(object sender, RoutedEventArgs e) { // Uložení hesla try { string pswd = ValidateAmininistrator.ValidateAdminPassword(pbAdminPswd.Password); if (pswd == pbAdminPswdAgain.Password) { DatabaseSetup.RecreateAppData(); Authentification.CreateAdministratorPassword(pbAdminPswd.Password); } else { DialogHelper.ShowWarning("Hesla se neshodují."); pbAdminPswdAgain.Password = string.Empty; pbAdminPswdAgain.Focus(); return; } } catch (InvalidAdminPasswordException ex) { DialogHelper.ShowWarning(ex.Message); pbAdminPswd.Password = string.Empty; pbAdminPswd.Focus(); return; } catch (AdministratorSetupFailedException ex) { DialogHelper.ShowError(ex.Message); return; } catch { return; } Success = true; this.Close(); }