public void CryptoGetTextPassword(out string password) { if (passwordDefined || !nextPassword) { password = currentPassword; return; } if (passwordCollection == null) { throw new IndexOutOfRangeException(); } if (!passwordCollection.MoveNext()) { throw new IndexOutOfRangeException(); } passwordRequested = true; var args = new PasswordEventArgs(currentPassword); if (PasswordAttempt != null) { PasswordAttempt(this, args); } if (!args.ContinueOperation) { throw new IndexOutOfRangeException(); } password = currentPassword = passwordCollection.Current; nextPassword = false; }
public void CryptoGetTextPassword(out string password) { if (passwordDefined || !nextPassword) { password = currentPassword; return; } if (passwordCollection == null) { throw new IndexOutOfRangeException(); } if (!passwordCollection.MoveNext()) { throw new IndexOutOfRangeException(); } passwordRequested = true; var args = new PasswordEventArgs(currentPassword); if (PasswordAttempt != null) { PasswordAttempt(this, args); } if (!args.ContinueOperation) { throw new IndexOutOfRangeException(); } password = currentPassword = passwordCollection.Current; nextPassword = false; }
private void OnPasswordAttempt(object sender, PasswordEventArgs e) { owner.BeginInvoke( new SetStatus(status => { Item.SubStatus = status; }), String.Format(CultureInfo.CurrentCulture, "Password: {0}", e.Password) ); e.ContinueOperation = !owner.aborted && !owner.stopped; }