public MainWindow() { Generator = new PasswordGenerator(); WarningTextOn = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0)); WarningTextOff = new SolidColorBrush(Color.FromArgb(0, 255, 0, 0)); WarningBoxOn = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0)); WarningBoxOff = new SolidColorBrush(Color.FromArgb(255, 94, 94, 94)); InitializeComponent(); }
private void GenerateButtonClick(object sender, RoutedEventArgs e) { var range = CharacterRange.LowercaseEnglishLetters + CharacterRange.UppercaseEnglishLetters; if (UseDigitsCheckBox.IsChecked) { range += CharacterRange.Digits; } if (UseSpecialSymbolsCheckBox) { range += CharacterRange.SpecialCharacters; } var password = new PasswordGenerator(range).MakePassword(PasswordLengthSlider.Value); ResultTextBox.Text = password; }