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 RefreshAllMessagePanelProcess() { Messages messages = new Messages(this.Session); MessageObjects allobjects = messages.GetAllMessage(); this.Dispatcher.Invoke(DispatcherPriority.Normal, new RefreshAllMessagePanelCallbackDelegate(RefreshAllMessagePanelCallback), allobjects); }
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); } }
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 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); }