Exemplo n.º 1
0
 public static void LoadAuthenticatedUserFromCache(ILoginMethods login, ISecureBlobCache loginCache)
 {
     Observable.Zip(loginCache.GetObjectAsync <string>("BaseUrl"), loginCache.GetObjectAsync <string>("Token"),
                    (url, name) => new Tuple <string, string>(url, name))
     .Catch(Observable.Return <Tuple <string, string> >(null))
     .Subscribe(x => {
     });
 }
Exemplo n.º 2
0
 public static void LoadAuthenticatedUserFromCache(ILoginMethods login, ISecureBlobCache loginCache)
 {
     Observable.Zip(loginCache.GetObjectAsync<string>("BaseUrl"), loginCache.GetObjectAsync<string>("Token"),
         (url, name) => new Tuple<string, string>(url, name))
         .Catch(Observable.Return<Tuple<string, string>>(null))
         .Subscribe(x => {
         });
 }
Exemplo n.º 3
0
 /// <summary>
 /// Returns the currently cached user/password. If the cache does not
 /// contain a user/password, this returns an Observable which
 /// OnError's with KeyNotFoundException.
 /// </summary>
 /// <returns>A Future result representing the user/password Tuple.</returns>
 public static IObservable <LoginInfo> GetLoginAsync(this ISecureBlobCache This, string host = "default")
 {
     return(This.GetObjectAsync <Tuple <string, string> >("login:" + host).Select(x => new LoginInfo(x)));
 }