Ejemplo n.º 1
0
 private void ShowDialog(object args)
 {
     if (!Application.IsApplicationThread || !(args is UserCredentialRequestArguments))
     {
         return;
     }
     if (this._inputDialog != null)
     {
         this._inputDialog.Dispose();
         this._inputDialog = null;
     }
     this._credentials = (UserCredentialRequestArguments)args;
     this._inputDialog = new ProxySignIn(this._credentials, new EventHandler(OnDialogSignIn), new EventHandler(OnDialogCanceled));
     this._inputDialog.Show();
     this._lastUIPathPrompted = ZuneShell.DefaultInstance.CurrentPage.UIPath;
 }
Ejemplo n.º 2
0
 private bool GetCredentials(UserCredentialRequestArguments args)
 {
     this._completed = false;
     if (this.CancelCount >= 3U || this.SignInCount >= 3U || this._lastUIPathPrompted == ZuneShell.DefaultInstance.CurrentPage.UIPath && this._lastSignInTargetUrl != args.TargetUrl)
     {
         if (args != null && args.Credential != null)
         {
             args.Credential.UserName = string.Empty;
             args.Credential.Password = string.Empty;
         }
     }
     else if (!Application.IsApplicationThread && this._dialogClosed == null)
     {
         this._dialogClosed = new EventWaitHandle(false, EventResetMode.ManualReset);
         Application.DeferredInvoke(new DeferredInvokeHandler(this.ShowDialog), args);
         this._dialogClosed.WaitOne();
         this._dialogClosed.Close();
         this._dialogClosed = null;
     }
     return(this._completed);
 }