NetworkCredential Preprocessing.ICredentialsCache.QueryCredentials(Uri uri, string authType)
 {
     lock (credentialCacheLock)
     {
         if (credentialCache == null)
         {
             credentialCache = new NetworkCredentialsStorage(credentialsCacheStorage);
         }
         var cred = credentialCache.GetCredential(uri);
         if (cred != null)
         {
             return(cred);
         }
         var ret = uiInvoke.Invoke <NetworkCredential>(() =>
                                                       NetworkCredentialsDialogController.ShowSheet(parentWindow, NetworkCredentialsStorage.StripToPrefix(uri).ToString())).Result;
         if (ret == null)
         {
             return(null);
         }
         credentialCache.Add(uri, ret);
         credentialCache.StoreSecurely();
         return(ret);
     }
 }
 NetworkCredential Preprocessing.ICredentialsCache.QueryCredentials(Uri uri, string authType)
 {
     lock (credentialCacheLock)
     {
         if (credentialCache == null)
         {
             credentialCache = new NetworkCredentialsStorage(credentialsCacheStorage);
         }
         var cred = credentialCache.GetCredential(uri);
         if (cred != null)
         {
             return(cred);
         }
         var ret = uiInvokeSynchronization.Invoke <NetworkCredential>(() =>
                                                                      CredUIUtils.ShowCredentialsDialog(appWindow.Handle, NetworkCredentialsStorage.StripToPrefix(uri).ToString())).Result;
         if (ret == null)
         {
             return(null);
         }
         credentialCache.Add(uri, ret);
         credentialCache.StoreSecurely();
         return(ret);
     }
 }