private void UpdateButton_Click(object sender, RoutedEventArgs e) { Messages m = new Messages(this.Session); m.PostMessage(UpdateText.Text); // m.CompletedPost += ; // Storyboard Start UpdateText.Text = string.Empty; }
private void RefreshSentMessagePanelProcess() { Messages messages = new Messages(this.Session); MessageObjects sentobjects = messages.GetSentMessage(); this.Dispatcher.Invoke(DispatcherPriority.Normal, new RefreshSentMessagePanelCallbackDelegate(RefreshSentMessagePanelCallback), sentobjects); }
void ReplyPanelReplyButton_Click(object sender, RoutedEventArgs e) { Messages messages = new Messages(this.Session); messages.PostMessage(this.ReplyPanel.ReplyText.Text, this.ReplyPanel.ReplyID); this.ReplyPanel.ReplyText.Text = string.Empty; this.ReplyPanel.Visibility = Visibility.Collapsed; TabControlMessages.Opacity = 1.0; TabControlMessages.IsEnabled = true; }
private void RefreshMessageProcess() { Messages messages = new Messages(this.Session); MessageObjects allobjects = messages.GetAllMessage(); MessageObjects sentobjects = messages.GetSentMessage(); MessageObjects followingobjects = messages.GetFollowingMessage(); MessageObjects receivedobjects = messages.GetReceivedMessage(); this.Dispatcher.Invoke(DispatcherPriority.Normal, new RefreshMessagePanelsCallbackDelegate(RefreshMessagePanelsCallback), allobjects, sentobjects, followingobjects, receivedobjects); }
private void InitialCheck() { OAuthKey oauth = GetOAuthKey(); WebProxy proxy = GetProxy(); //oauth = null; // tmp if (oauth == null) { this.Dispatcher.Invoke(DispatcherPriority.Normal, new AuthPanelShowDelegate(AuthPanelShow)); } try { Session session = new Session(oauth, proxy); this.Session = session; Messages messages = new Messages(this.Session); MessageObjects allobjects = messages.GetAllMessage(); this.Dispatcher.Invoke(DispatcherPriority.Normal, new MainPanelShowDelegate(MainPanelShow), allobjects); } catch (Exception) { this.Dispatcher.Invoke(DispatcherPriority.Normal, new AuthPanelShowDelegate(AuthPanelShow)); } }
private void FeedCycleCheck() { Messages messages = new Messages(this.Session); MessageObjects objects = messages.GetAllMessage(this.MostLastestMessageId); if (objects.Messages.Count > 0) { this.Dispatcher.Invoke(DispatcherPriority.Normal, new FeedCheckerDelegate(FeedCheckerShow), objects); } }
void DeleteButton_Click(object sender, RoutedEventArgs e) { Button button = sender as Button; Canvas canvas = button.Parent as Canvas; MessagePanel mp = canvas.Parent as MessagePanel; Messages messages = new Messages(this.Session); messages.DeleteMessage((int)mp.DataContext); MessageBox.Show("Message Deleted."); // tmp }
private void CreateMessagePanels() { Messages messages = new Messages(this.session); MessageObjects allobjects = messages.GetAllMessage(); List<Message> msgs = allobjects.Messages; int index = rand.Next(msgs.Count); Message msg = msgs[index]; TextBlock tb = new TextBlock(); tb.Text = msg.Body.Plain; tb.FontSize = 14; this.MainCanvas.Children.Add(tb); double centerX = this.MainCanvas.ActualWidth / 2.0; double centerY = this.MainCanvas.ActualHeight / 2.0; double offsetX = 16 - rand.Next(32); double offsetY = 16 - rand.Next(32); //tb.SetValue(Canvas.LeftProperty, centerX + offsetX); //tb.SetValue(Canvas.TopProperty, centerY + offsetY); tb.SetValue(Canvas.LeftProperty, centerX ); tb.SetValue(Canvas.TopProperty, centerY ); double duration = 6.0 + 10.0 * rand.NextDouble(); double delay = 16.0 * rand.NextDouble(); //TranslateTransform offsetTransform = new TranslateTransform(); //DoubleAnimation offsetXAnimation = new DoubleAnimation(0.0, -256.0, new Duration(TimeSpan.FromSeconds(duration))); //offsetXAnimation.RepeatBehavior = RepeatBehavior.Forever; //offsetXAnimation.BeginTime = TimeSpan.FromSeconds(delay); //offsetTransform.BeginAnimation(TranslateTransform.XProperty, offsetXAnimation); //offsetTransform.BeginAnimation(TranslateTransform.YProperty, offsetXAnimation); //tb.RenderTransform = offsetTransform; DoubleAnimation opacityAnimation = new DoubleAnimation(0.0, 1.0, new Duration(TimeSpan.FromSeconds(4.0))); opacityAnimation.RepeatBehavior = RepeatBehavior.Forever; tb.BeginAnimation(TextBlock.OpacityProperty, opacityAnimation); }