void accounts_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     if (e.NewItems != null)
     {
         foreach (Model.Account account in e.NewItems)
         {
             AppNetDotNet.ApiCalls.Parameters parameters = new AppNetDotNet.ApiCalls.Parameters();
             parameters.count = 200;
             Tuple <List <AppNetDotNet.Model.User>, AppNetDotNet.ApiCalls.ApiCallResponse> followings = AppNetDotNet.ApiCalls.Users.getFollowingsOfUser(account.access_token, account.username, parameters);
             if (followings.Item2.success)
             {
                 foreach (AppNetDotNet.Model.User following in followings.Item1)
                 {
                     if (!savedUsernames.Contains(following.username))
                     {
                         savedUsernames.Add("@" + following.username);
                     }
                 }
             }
             Tuple <List <AppNetDotNet.Model.User>, AppNetDotNet.ApiCalls.ApiCallResponse> followers = AppNetDotNet.ApiCalls.Users.getFollowersOfUser(account.access_token, account.username, parameters);
             if (followers.Item2.success)
             {
                 foreach (AppNetDotNet.Model.User follower in followers.Item1)
                 {
                     if (!savedUsernames.Contains(follower.username))
                     {
                         savedUsernames.Add("@" + follower.username);
                     }
                 }
             }
         }
     }
 }
Beispiel #2
0
 void accounts_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     if (e.NewItems != null)
     {
         foreach (Model.Account account in e.NewItems)
         {
             AppNetDotNet.ApiCalls.Parameters parameters = new AppNetDotNet.ApiCalls.Parameters();
             parameters.count = 200;
             Tuple<List<AppNetDotNet.Model.User>,AppNetDotNet.ApiCalls.ApiCallResponse> followings = AppNetDotNet.ApiCalls.Users.getFollowingsOfUser(account.access_token,account.username,parameters);
             if(followings.Item2.success) {
                 foreach(AppNetDotNet.Model.User following in followings.Item1) {
                     if(!savedUsernames.Contains(following.username)) {
                         savedUsernames.Add("@" + following.username);
                     }
                 }
             }
             Tuple<List<AppNetDotNet.Model.User>, AppNetDotNet.ApiCalls.ApiCallResponse> followers = AppNetDotNet.ApiCalls.Users.getFollowersOfUser(account.access_token, account.username, parameters);
             if (followers.Item2.success)
             {
                 foreach (AppNetDotNet.Model.User follower in followers.Item1)
                 {
                     if (!savedUsernames.Contains(follower.username))
                     {
                         savedUsernames.Add("@" + follower.username);
                     }
                 }
             }
         }
     }
 }