protected void Button_Click(object sender, EventArgs e) { try { if (sender.Equals(replyButton)) { if (parent.GetType() == typeof(DiscussionPopup)) { DiscussionPopup castedParent = (DiscussionPopup)parent; castedParent.CommentBoxDefault.Text = "Replying to " + username + "'s comment: \"" + comment + "\". Type a message..."; castedParent.SetReplyFlag(1); castedParent.SetCommentToReplyTo(this); castedParent.CommentBox.Focus(); } else if (parent.GetType() == typeof(PhotoPopup)) { PhotoPopup castedParent = (PhotoPopup)parent; castedParent.commentBoxDefault.Text = "Replying to " + username + "'s comment: \"" + comment + "\". Type a comment..."; castedParent.SetReplyFlag(1); castedParent.SetCommentToReplyTo(this); castedParent.commentBox.Focus(); } } } catch (NullReferenceException exception) { //This is due to the par } }
/// <summary> /// Handles a clicked photo. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void PhotoClick(object sender, MouseButtonEventArgs e) { Photo tmp = (Photo)sender; PhotoPopup photoPopup = new PhotoPopup(parent, this, photoDict[tmp.photoId]); photoPopup.SetValue(Grid.RowProperty, 2); photoPopup.SetValue(Grid.ColumnSpanProperty, 3); parent.mainGrid.Children.Add(photoPopup); }
public Comment(string username, string comment, PhotoPopup parent) { InitializeComponent(); this.username = username; this.comment = comment; usernameText.Text = username; commentBox.Text = comment; this.parent = parent; CurrentUser = false; }
private void ClickPost(object sender, MouseEventArgs e) { if (sender.Equals(discussion)) { DiscussionPopup discussionPopup = new DiscussionPopup(parent, discussion); discussionPopup.SetValue(Grid.RowProperty, 2); discussionPopup.SetValue(Grid.ColumnSpanProperty, 3); parent.mainGrid.Children.Add(discussionPopup); } else { PhotoPopup photoPopup = new PhotoPopup(parent, photo); photoPopup.SetValue(Grid.RowProperty, 2); photoPopup.SetValue(Grid.ColumnSpanProperty, 3); parent.mainGrid.Children.Add(photoPopup); } }
private void ClickPost(object sender, MouseEventArgs e) { if (sender.GetType() == typeof(Discussion)) { Discussion temp = (Discussion)sender; DiscussionPopup discussionPopup = new DiscussionPopup(parent, temp); discussionPopup.SetValue(Grid.RowProperty, 2); discussionPopup.SetValue(Grid.ColumnSpanProperty, 3); parent.mainGrid.Children.Add(discussionPopup); } else if (sender.GetType() == typeof(Photo)) { Photo temp = (Photo)sender; PhotoPopup photoPopup = new PhotoPopup(parent, temp); photoPopup.SetValue(Grid.RowProperty, 2); photoPopup.SetValue(Grid.ColumnSpanProperty, 3); parent.mainGrid.Children.Add(photoPopup); } }
public void NotificationClick(object sender, RoutedEventArgs e) { Button tmp = (Button)sender; Notification temp = (Notification)tmp.Parent; if (temp.notificationContent.Text.ToString().Contains("Lawrence")) { temp.Read(); } notificationsButtonDropdown.IsOpen = false; Photo randomPhoto = new Photo(357, "/Images/trackfield.jpg"); randomPhoto.title = "On your marks..."; randomPhoto.caption = "I tried a bit of black and white."; randomPhoto.username = "******"; randomPhoto.score = 2; randomPhoto.displaySideInfo(); PhotoPopup popup = new PhotoPopup(this, randomPhoto); popup.SetValue(Grid.RowProperty, 2); popup.SetValue(Grid.ColumnSpanProperty, 3); mainGrid.Children.Add(popup); }
public HelpPromptPopup(PhotoPopup parent) { InitializeComponent(); this.parent = parent; }
public MessageDevelopmentPrompt(PhotoPopup parent) { InitializeComponent(); this.parent = parent; }