// Chosing album in listbox public void FillPanel(IAlbumOperable i_FormToFill) { UILogicHelper.MakeControlsInvisible(i_FormToFill.ListBoxAlbums); i_FormToFill.PhotosAlbum = i_FormToFill.UsersAlbums.ElementAt(i_FormToFill.ListBoxAlbums.SelectedIndex); fillPanelByPhotos(i_FormToFill); UILogicHelper.MakeControlsVisible(i_FormToFill.ButtonSlideshow); }
private void stopSlideShow() { UILogicHelper.MakeControlsVisible(playButton); UILogicHelper.MakeControlsInvisible(stopButton); timerForSlideShow.Enabled = false; m_AudioPlayer.Stop(); }
public void PlaySlideShow() { UILogicHelper.MakeControlsVisible(stopButton); UILogicHelper.MakeControlsInvisible(playButton); timerForSlideShow.Enabled = true; m_AudioPlayer.Play(); }
private void makeLocalComponentsVisible() { this.Invoke(new Action(() => { UILogicHelper.MakeControlsInvisible(buttonLogin); UILogicHelper.MakeControlsVisible(labelHelloUser, buttonLogout, pictureBoxUser, buttonShowFriends, buttonMyPosts, buttonMakePost, buttonAlbums); })); }
//sending post to the wall on 'enter' click private void onKeyDownHandler(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { m_Facade.PostStatus(textBoxPost.Text); UILogicHelper.MakeControlsVisible(textBoxPost); MessageBox.Show("Your post was successfully post."); } }
// Logout From Account private void buttonLogout_Click(object sender, EventArgs e) { // Calling method doLogout m_Facade.LogOut(); closeAllComponents(); UILogicHelper.MakeControlsVisible(buttonLogin); UILogicHelper.MakeControlsInvisible(buttonLogout, pictureBoxUser, buttonShowFriends, labelHelloUser, buttonMyPosts, buttonMakePost, textBoxPost, buttonAlbums); }
private void showCommonGroups() { List <string> commonGroups = null; closeAllComponents(); UILogicHelper.MakeControlsVisible(listBoxCommonGroups); new Thread(() => { commonGroups = FriendsFacade.FindCommonGroups(); fillListBox(listBoxMutualFriends, commonGroups, r_NoCommonGroups); }).Start(); }
private void showAlbums() { closeAllComponents(); this.Invoke(new Action(() => { UILogicHelper.MakeControlsVisible(forAlbumsListBoxLabel, createdTimeLabel, createdTimeLabel1, imageAlbumLabel, imageAlbumPictureBox, nameLabel, nameLabel1, forAlbumsListBoxLabel); })); ListBoxAlbums = listBoxFriendAlbums; UsersAlbums = FriendsFacade.GetUserAlbums(); m_AlbumOperator.ShowAlbums(this, albumBindingSource); }
public void ShowAlbums(IAlbumOperable i_FormToFill, BindingSource io_AlbumBindingSource) { i_FormToFill.ListBoxAlbums.Invoke(new Action( () => { UILogicHelper.MakeControlsVisible(i_FormToFill.ListBoxAlbums); i_FormToFill.ListBoxAlbums.BringToFront(); if (i_FormToFill.UsersAlbums.Count > 0) { io_AlbumBindingSource.DataSource = i_FormToFill.UsersAlbums; } })); }
private void fillPanelByPhotos(IAlbumOperable i_FormToFill) { int index = 0; LazyPictureBox[] albumPictureBoxes = new LazyPictureBox[i_FormToFill.PhotosAlbum.Photos.Count]; double panelWidth = i_FormToFill.PhotosPanel.Width; int pictureWidth = (int)(panelWidth / 3); int pictureHeigt = pictureWidth; Point currPictureLocation = new Point(i_FormToFill.PhotosPanel.Location.X, i_FormToFill.PhotosPanel.Location.Y); i_FormToFill.PhotosPanel.Controls.Clear(); UILogicHelper.MakeControlsVisible(i_FormToFill.PhotosPanel, i_FormToFill.AlbumNameLabel); i_FormToFill.PhotosPanel.AutoScroll = true; i_FormToFill.AlbumNameLabel.Text = i_FormToFill.PhotosAlbum.Name; foreach (Photo photo in i_FormToFill.PhotosAlbum.Photos) { //check with static index: this for delete photoSerialNum albumPictureBoxes[index] = new LazyPictureBox(); int photoSerialNum = index; albumPictureBoxes[index].Click += (sender, e) => RunPictureShower(i_FormToFill.PhotosAlbum, (sender as PictureBox).Image, photoSerialNum); albumPictureBoxes[index].Location = currPictureLocation; albumPictureBoxes[index].Size = new Size(pictureWidth, pictureHeigt); albumPictureBoxes[index].SizeMode = PictureBoxSizeMode.StretchImage; i_FormToFill.PhotosPanel.Controls.Add(albumPictureBoxes[index]); currPictureLocation = new Point(currPictureLocation.X + pictureWidth, currPictureLocation.Y); index++; if ((index) % 3 == 0) { currPictureLocation = new Point(i_FormToFill.PhotosPanel.Location.X, currPictureLocation.Y + pictureHeigt); } } index = 0; new Thread(() => { foreach (Photo photo in i_FormToFill.PhotosAlbum.Photos) { albumPictureBoxes[index++].Load(photo.PictureNormalURL); } }).Start(); }
private void showFriends() { closeAllComponents(); listBoxFriends.Invoke(new Action( () => { listBoxFriends.Items.Clear(); UILogicHelper.MakeControlsVisible(listBoxFriends, forFriendsListBoxLabel); if (m_Facade.GetFriendsNumber() > 0) { foreach (String friend in m_Facade) { listBoxFriends.Items.Add(friend); } } else { listBoxFriends.Items.Add(r_NoFriendsMessage); } })); }
// Post on Friend's Timeline private void buttonPostToFriend_Click(object sender, EventArgs e) { closeAllComponents(); textBoxPostFriend.Text = "Enter your post"; UILogicHelper.MakeControlsVisible(textBoxPostFriend); }
// Profile Picture Clicking private void pictureBoxUser_Click(object sender, EventArgs e) { closeAllComponents(); pictureBoxLargeFoto.LoadAsync(m_Facade.GetBigProfilePicture()); UILogicHelper.MakeControlsVisible(buttonClosePicture, pictureBoxLargeFoto); }