Ejemplo n.º 1
0
 private void HandleNewMessageSavedEvent(NewMessageEvent obj)
 {
     lock (this)
     {
         if (obj.Message != null &&
             !obj.Message.IsTaskMessage.Value &&
             !obj.Message.IsTaskInfoMessage &&
             !obj.Message.IsTaskItemMessage &&
             !this.suspend)
         {
             if (!this.newMessages.Contains(obj.Message))
             {
                 this.newMessages.Add(obj.Message);
                 DispatcherHelper.InvokeOnUiThread(() =>
                 {
                     this.NotifyPropertyChanged("Count");
                     this.NotifyPropertyChanged("IsNewMessageAvailable");
                 });
             }
         }
     }
 }
Ejemplo n.º 2
0
 private void HandleNewMessageSavedEvent(NewMessageEvent obj)
 {
     lock (this)
     {
         MessageModel task = obj.Message as MessageModel;
         if (task != null)
         {
             DispatcherHelper.InvokeOnUiThread(() =>
                 {
                     MessageModel m = DataSync.Instance.GetMessageFromClientId(task.ClientMessageId);
                     if (m != null)
                     {
                         m.LoadTaskList();
                         this.AddTask(m);
                     }
                 });
         }
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Handles a push notification
 /// </summary>
 /// <param name="pushEvent"></param>
 private void HandleNewMessageSentEvent(NewMessageEvent messageEvent)
 {
     this.HandleNewMessage(messageEvent.Message, messageEvent.IsPush);
 }
Ejemplo n.º 4
0
        private void MessageSavedEvent(NewMessageEvent obj)
        {
            DispatcherHelper.InvokeOnUiThread(() =>
                {
                    if (obj.Message != null && obj.Message.ClientMessageId == ((MessageModel)this.DataContext).ClientMessageId)
                    {
                        this.ShareTaskPopup.Visibility = Visibility.Collapsed;
                        this.ShareTaskPopup.IsOpen = false;
                        this.ProgressIndicator.IsVisible = false;

                        ((MessageModel)this.DataContext).NotifyPropertyChanged("IsTaskShared");
                        ((MessageModel)this.DataContext).NotifyPropertyChanged("TaskSharedWithString");

                        foreach (var button in ApplicationBar.Buttons)
                        {
                            ((ApplicationBarIconButton)button).IsEnabled = true; // disables the button
                        }

                        ((MessageModel)this.DataContext).TaskItemList = null;
                        ((MessageModel)this.DataContext).LoadTaskList();

                        this.TasksListSelector.ItemsSource = this.message.TaskItemList;

                        if (message.TaskItemList != null &&
                            (message.TaskItemList.Count > 0 && message.TaskItemList[0].CompareTo(pullMeDownMessage) != 0) ||
                            message.TaskItemList.Count == 0)
                        {
                            //message.TaskItemList.Add(pullMeDownMessage);
                        }
                    }

                    if (obj.Message != null)
                    {
                        Messenger.Default.Send<RefreshTaskMessage>(new RefreshTaskMessage() { TaskId = obj.Message.ClientMessageId });
                    }
                });
        }
Ejemplo n.º 5
0
 private void HandleNewMessageEvent(NewMessageEvent newMessageEvent)
 {
     this.HandleNewMessageEvent(newMessageEvent.Message, newMessageEvent.IsPush);
 }