예제 #1
0
 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.GetRelevantPart(uri).ToString(),
                                                                                                        authType == "protected-archive")).Result;
         if (ret == null)
         {
             return(null);
         }
         credentialCache.Add(uri, ret);
         credentialCache.StoreSecurely();
         return(ret);
     }
 }
예제 #2
0
 NetworkCredential Preprocessing.ICredentialsCache.QueryCredentials(Uri uri, string authType)
 {
     lock (credentialCacheLock)
     {
         if (credentialCache == null)
         {
             credentialCache = new NetworkCredentialsStorage(credentialsCacheStorage, new Persistence.SystemDataProtection());
         }
         var cred = credentialCache.GetCredential(uri);
         if (cred != null)
         {
             return(cred);
         }
         var ret = uiInvoke.Invoke <NetworkCredential>(() =>
                                                       NetworkCredentialsDialogController.ShowSheet(parentWindow,
                                                                                                    NetworkCredentialsStorage.GetRelevantPart(uri).ToString(),
                                                                                                    authType == "protected-archive")).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 = uiInvoke.Invoke <NetworkCredential>(() =>
                                                       NetworkCredentialsDialogController.ShowSheet(parentWindow, NetworkCredentialsStorage.StripToPrefix(uri).ToString())).Result;
         if (ret == null)
         {
             return(null);
         }
         credentialCache.Add(uri, ret);
         credentialCache.StoreSecurely();
         return(ret);
     }
 }