/* ----------------------------------------------------------------- */ /// /// ArchiveRtSettingsForm /// /// <summary> /// オブジェクトを初期化します。 /// </summary> /// /* ----------------------------------------------------------------- */ public ArchiveRtSettingsForm() { InitializeComponent(); _password = new PasswordBehavior(PasswordTextBox, ConfirmTextBox, ShowPasswordCheckBox); _password.Updated += (s, e) => UpdateEncryptionCondition(); UpdateThreadCount(); UpdateFormat(); UpdateCompressionLevel(); UpdateCompressionMethod(); UpdateEncryptionMethod(); UpdateEncryptionCondition(); ExecuteButton.Enabled = false; ExecuteButton.Click += (s, e) => Close(); ExitButton.Click += (s, e) => Close(); EncryptionCheckBox.CheckedChanged += (s, e) => UpdateEncryptionCondition(); OutputButton.Click += WhenPathRequested; OutputTextBox.TextChanged += WhenPathChanged; FormatComboBox.SelectedValueChanged += WhenFormatChanged; CompressionMethodComboBox.SelectedValueChanged += WhenCompressionMethodChanged; }
/* ----------------------------------------------------------------- */ /// /// PasswordForm /// /// <summary> /// オブジェクトを初期化します。 /// </summary> /// /* ----------------------------------------------------------------- */ public PasswordConfirmForm() { InitializeComponent(); IconPictureBox.Image = StockIcons.Warning.GetIcon(IconSize.Large).ToBitmap(); ExecuteButton.Click += (s, e) => Close(); ExitButton.Click += (s, e) => Close(); _behavior = new PasswordBehavior(PasswordTextBox, ConfirmTextBox, ShowPasswordCheckBox); _behavior.Updated += (s, e) => ExecuteButton.Enabled = _behavior.IsValid; }
public void Create() { var view = new PasswordBox(); var src = new PasswordBehavior(); src.Attach(view); src.Password = "******"; Assert.That(view.Password, Is.EqualTo(src.Password).And.EqualTo("Behavior")); view.Password = "******"; Assert.That(src.Password, Is.EqualTo(view.Password).And.EqualTo("View")); src.Detach(); }