/// <summary> /// The following method is used to create the tweet model list for viewing on on the xaml /// by assigning the friend infromation to each friend and wraps every friend to the wrapper's TweetModelList /// /// Precondition: none /// Postcondition: none /// </summary> /// <param name="friendsList">passed in friendslist values</param> public void CreateTweetModelList(List <UserModel> friendsList) { Wrapper = new TweetModelListWrapper(); List <TweetModel> tweetModelList = new List <TweetModel>(); foreach (UserModel friend in friendsList) { try { List <TweetEntity> tweetList = _twitterHttpClient.GetUserTweetList(friend.UserId, _MaxTweetsToRetrieve, true); tweetModelList = tweetList.Select(GenerateTweetModelFrom).ToList(); Console.WriteLine("HERE " + friend.UserName + " " + tweetModelList.Count); Wrapper.TweetModelList.AddRange(tweetModelList); /*if(Wrapper.TweetModelList != null) * { * MessageBox.Show($"{Wrapper.TweetModelList.Count}"); * }*/ } catch (Exception exception) { Console.WriteLine($"CreatTweetModelList => {exception.Message}"); } } }
/// <summary> /// This constructor is used for accessing the user information for TwitterCompiler to use. /// /// Preconditions: all cannot be null. /// Postconditions: all are assigned to their property counterpart or are newly initialized /// </summary> /// <param name="user">passed in user information</param> public UserModel(UserEntity user) { UserId = user.Id; UserName = user.Name; ScreenName = user.ScreenName; ProfileImageUrl = user.ProfileImageUrl; TweetRetweetModelList = new List <TweetModel>(); TweetModelListWrapper = new TweetModelListWrapper(); RetweetModelListWrapper = new TweetModelListWrapper(); }