Пример #1
0
 public void LoadData()
 {
     this._isLoaded  = false;
     this._isError   = false;
     this._isLoading = true;
     this.NotifyProperties();
     this._friendsImportProvider.CompleteLogin((Action <bool>)(succeeded =>
     {
         if (!succeeded)
         {
             this._isError   = true;
             this._isLoading = false;
             this._isLoaded  = true;
             this.NotifyProperties();
         }
         else
         {
             FriendsImportHelper.LoadData(this._friendsImportProvider, (Action <FriendsImportResponse>)(response => Execute.ExecuteOnUIThread((Action)(() =>
             {
                 List <ISubscriptionItemHeader> foundUsers = response.FoundUsers;
                 List <ISubscriptionItemHeader> otherUsers = response.OtherUsers;
                 if (foundUsers.Count > 0)
                 {
                     Group <ISubscriptionItemHeader> group = new Group <ISubscriptionItemHeader>("", false);
                     foreach (ISubscriptionItemHeader subscriptionItemHeader in foundUsers)
                     {
                         group.Add(subscriptionItemHeader);
                     }
                     this.Collection.Add(group);
                 }
                 if (otherUsers.Count > 0)
                 {
                     Group <ISubscriptionItemHeader> group = new Group <ISubscriptionItemHeader>(CommonResources.Title_InviteToVK, false);
                     foreach (ISubscriptionItemHeader subscriptionItemHeader in otherUsers)
                     {
                         group.Add(subscriptionItemHeader);
                     }
                     this.Collection.Add(group);
                 }
                 this._isLoading = false;
                 this._isLoaded = true;
                 this.NotifyProperties();
             }))), (Action <ResultCode>)(resultCode =>
             {
                 this._isError   = true;
                 this._isLoading = false;
                 this._isLoaded  = true;
                 this.NotifyProperties();
             }));
         }
     }));
 }
Пример #2
0
 public void LoadData()
 {
     this._isLoaded  = false;
     this._isError   = false;
     this._isLoading = true;
     this.NotifyProperties();
     this._friendsImportProvider.CompleteLogin((Action <bool>)(succeeded =>
     {
         if (!succeeded)
         {
             this._isError   = true;
             this._isLoading = false;
             this._isLoaded  = true;
             this.NotifyProperties();
         }
         else
         {
             FriendsImportHelper.LoadData(this._friendsImportProvider, delegate(FriendsImportResponse response)
             {
                 Execute.ExecuteOnUIThread(delegate
                 {
                     List <ISubscriptionItemHeader> foundUsers = response.FoundUsers;
                     List <ISubscriptionItemHeader> otherUsers = response.OtherUsers;
                     if (foundUsers.Count > 0)
                     {
                         Group <ISubscriptionItemHeader> group = new Group <ISubscriptionItemHeader>("", false);
                         using (List <ISubscriptionItemHeader> .Enumerator enumerator = foundUsers.GetEnumerator())
                         {
                             while (enumerator.MoveNext())
                             {
                                 ISubscriptionItemHeader current = enumerator.Current;
                                 group.Add(current);
                             }
                         }
                         this.Collection.Add(group);
                     }
                     if (otherUsers.Count > 0)
                     {
                         Group <ISubscriptionItemHeader> group2 = new Group <ISubscriptionItemHeader>(CommonResources.Title_InviteToVK, false);
                         using (List <ISubscriptionItemHeader> .Enumerator enumerator = otherUsers.GetEnumerator())
                         {
                             while (enumerator.MoveNext())
                             {
                                 ISubscriptionItemHeader current2 = enumerator.Current;
                                 group2.Add(current2);
                             }
                         }
                         this.Collection.Add(group2);
                     }
                     this._isLoading = false;
                     this._isLoaded  = true;
                     this.NotifyProperties();
                 });
             }, delegate(ResultCode resultCode)
             {
                 this._isError   = true;
                 this._isLoading = false;
                 this._isLoaded  = true;
                 this.NotifyProperties();
             });
         }
     }));
 }