You are on page 1of 2

AddUserControl Method:

 Add the UserControl from the parameter to the Containerpanel.

MyApp_Load Event:
 Click the Home Button.
 GetRequestFrom(activeUser).

GetRequestFrom Method:
 Clear the user List of Requests.
 Read the List of Requests of the User sent by parameter from the File.

Home Button:
 Get an instance of the homepanel and add it to the Containerpanel at the end.
 Button CreatePost with a textbox.
 Clear the activeuser List of Posts, and Friends.
 Read the List of Friends of the activeuser from the file.
 Read the Posts of the activeuser’s Friends and his and show them with a Like and
comment Buttons.
 Read the List of Likes and the dictionary of comments of all the posts of the activeuser
and Add it to the List of posts of the activeuser (since we already reading).

Request Button:
 Get an instance of the Friendspanel and add it to the Containerpanel at the end.
 show The List of Requests of the activUser with an AcceptFriend Button.

Friends suggestion Button:


 Get an instance of the Searchpanel and add it to the Containerpanel at the end.
 Foreach userToDisplay in “UsersInfo.txt”
 GetRequestFrom (userToDisplay).
♣ Check if the activeUser in the List of Requests of the userToDisplay.
♣ Check if the userToDisplay in the List of Requests of the activeUser.
♣ Check if the userToDisplay in the List of Friends of the activeUser.
 If (False and False and False), Display the userToDisplay username with an Add Friend
Button.

Profile Button:
 Get an instance of the Profilepanel and add it to the Containerpanel at the end.
 Display information about the user, and a Friends Button.
 When Displaying the List of Posts of the activeuser a Likes Button has been added to
show the List of Likes, according with same comments button as mentioned before.

Likes_Click Method:
 Get an instance of the showlikespanel and add it to the Containerpanel at the end.
 Display the List of Likes.

Friends_Click Method:
 Get an instance of the MyFriendspanel and add it to the Containerpanel at the end.
 Display the List of Friends.

AddFriendButton_Click Method:
 Write in the file the activeuser username in the Requests of the user shown.

AcceptFriendButton_Click Method:
 Add userToAdd to the List of Friends of the activeUser.
 Remove userToAdd from the List of Requests of the activeUser.
 Add activeUser to the List of Friends of the userToAdd.
 Do the same in the File.

CreatePostButton_Click Method:
 Add the Post created to the List of Posts of the activeUser and write it into the File.

LikeButton_Click Method:
 Get the Post that been assigned to the Tag property when the button was clicked.
 Add the activeUser (since he clicked it) the List of Likes of the post and write the
username of the activeUser in the likes of the post in the file.

commentsButton_Click Method:
 Get an instance of the commentspanel and add it to the Containerpanel at the end.
 Show the post that been assigned to the Tag property when the button was clicked.
 A textbox and Addcomment Button been displayed.
 Read all comments of the post from the file, and show them.

AddCommentsButton_Click Method:
 Write the comment to the File.

You might also like