Exemple #1
0
        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;
        }
Exemple #2
0
 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;
 }
Exemple #3
0
 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;
 }