private void loadAboutUserTab(object i_ObjectsToInit) { Dictionary <string, object> objectsToInit = i_ObjectsToInit as Dictionary <string, object>; if (objectsToInit != null) { (objectsToInit["birthDayBox"] as TextBox).Text = LoggedInUser.Birthday; try { (objectsToInit["genderBox"] as TextBox).Text = LoggedInUser.Gender.ToString(); } catch (Exception ex) { } (objectsToInit["livesInBox"] as TextBox).Text = LoggedInUser.Location.Name; initWorkPlaces(objectsToInit["workPlacesList"] as ListBox); initEducationPlaces(objectsToInit["educationList"] as ListBox); (objectsToInit["numberOfFriendsBox"] as RichTextBox).Text = LoggedInUser.Friends.Count.ToString(); (objectsToInit["numberOfPostsBox"] as RichTextBox).Text = LoggedInUser.Posts.Count.ToString(); (objectsToInit["numberOfAlbumsBox"] as RichTextBox).Text = LoggedInUser.Albums.Count.ToString(); } LoadedTabs.Add(eTab.AboutUser); }
private void loadPostsTab(object i_UserPostsList) { ListBox userPostsList = i_UserPostsList as ListBox; int counter = 0; foreach (Post post in LoggedInUser.Posts) { if (post.Message != null) { userPostsList?.Items.Add(post.Message); } else if (post.Caption != null) { userPostsList?.Items.Add(post.Caption); } counter++; if (counter >= k_MaxNumberOfPosts) { break; } } if (LoggedInUser.Posts.Count == 0) { throw new Exception("No Posts to retrieve :("); } LoadedTabs.Add(eTab.Posts); }
private void loadAlbumCreator(object i_ObjectToInit) { if (i_ObjectToInit is AlbumCreator albumCreator) { albumCreator.LoggedInUser = LoggedInUser; } LoadedTabs.Add(eTab.CreateAlbum); }
private void loadFriendsListTab(object i_ObjectToInit) { ListBox friendsBox = i_ObjectToInit as ListBox; foreach (User friend in LoggedInUser.Friends) { friendsBox?.Items.Add(friend.Name); } LoadedTabs.Add(eTab.FriendsList); }
private void loadAlbumCreator(object i_ObjectToInit) { AlbumCreator albumCreator = i_ObjectToInit as AlbumCreator; if (albumCreator != null) { albumCreator.LoggedInUser = LoggedInUser; } LoadedTabs.Add(eTab.CreateAlbum); }
public bool IsTabLoaded(Tab i_Tab) { bool result = LoadedTabs.Contains(i_Tab.TabType); return(result); }