コード例 #1
0
 protected virtual void OnTaskChanged(TaskChangedEventArgs e)
 {
     if (TaskChanged != null)
     {
         TaskChanged(this, e);
     }
 }
コード例 #2
0
 void INovaAlertServiceCallback.OnTaskChanged(TaskChangedEventArgs e)
 {
     if (this.MainController != null)
     {
         this.MainController.OnTaskChanged(e);
     }
 }
コード例 #3
0
        public TaskChangeModel(TaskChangedEventArgs taskChangeDetails)
        {
            Contract.Requires(taskChangeDetails != null);

            this.Task       = new TaskModel(taskChangeDetails.Task);
            this.ChangeType = taskChangeDetails.ChangeType;
        }
コード例 #4
0
        public override void OnTaskChanged(TaskChangedEventArgs e)
        {
            var up = this.ClientApp.Units.Items.Where(u => u.Id == e.Id).FirstOrDefault();

            if (up != null)
            {
                if (e.Task != null)
                {
                    up.Task.TaskObj = e.Task;
                }
                e.Handled = true;
            }
        }
コード例 #5
0
        public static void SendTaskChanged(TaskChangedEventArgs taskChangedDetails, IHubConnectionContext <dynamic> connectionContext)
        {
            Contract.Requires(taskChangedDetails != null);
            Contract.Requires(connectionContext != null);

            foreach (string key in UserConnectionsDictionary.Keys)
            {
                ApplicationUser user = UserConnectionsDictionary[key];
                if (user != null && taskChangedDetails.OwnerUserId == user.Id)
                {
                    connectionContext.Client(key).taskUpdated(new TaskChangeModel(taskChangedDetails));
                }
            }
        }
コード例 #6
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            var newTitle    = titleTextBox.Text;
            var newDeadline = deadlineDateTimePicker.Value;

            if (newTitle == _title && newDeadline == _deadline)
            {
                Close();
                return;
            }

            try
            {
                if (newTitle != _title)
                {
                    var changeTitleOnTask = new ChangeTitleOnTask(_taskId, newTitle);
                    _commandDispatcher.Send(changeTitleOnTask);
                }

                if (newDeadline != _deadline)
                {
                    var changeDeadlineOnTask = new ChangeDeadlineOnTask(_taskId, newDeadline);
                    _commandDispatcher.Send(changeDeadlineOnTask);
                }
            }
            catch (Exception ex)
            {
                _logger.ForContext("newTitle", newTitle).ForContext("newDeadline", newDeadline).Error(ex, "Something went wrong changing task title and/or deadline");
                MessageBox.Show("Sorry, something went wrong changing task title and/or deadline", "Error",
                                MessageBoxButtons.OK);
            }

            if (TaskChanged != null)
            {
                var eventArgs = new TaskChangedEventArgs(_taskId, newTitle, newDeadline, _title);
                TaskChanged(this, eventArgs);
            }

            Close();
        }
コード例 #7
0
        private void changeTaskForm_TaskChanged(object sender, TaskChangedEventArgs e)
        {
            int indexOfSelectedTask = -1;

            for (int rowIndex = 0; rowIndex < taskGrid.Rows.Count; rowIndex++)
            {
                var titleColumn   = taskGrid.Columns["Title"];
                var titleCell     = taskGrid.Rows[rowIndex].Cells[titleColumn.Index];
                var existingTitle = titleCell.Value;
                if (existingTitle.ToString() == e.OldTitle)
                {
                    indexOfSelectedTask = rowIndex;
                    if (existingTitle.ToString() != e.NewTitle)
                    {
                        titleCell.Value = e.NewTitle;
                    }

                    var deadlineColumn  = taskGrid.Columns["Deadline"];
                    var deadlineCell    = taskGrid.Rows[rowIndex].Cells[deadlineColumn.Index];
                    var currentDeadline = deadlineCell.Value;
                    if (currentDeadline == null || e.NewDeadline != DateTime.Parse(currentDeadline.ToString()))
                    {
                        deadlineCell.Value = e.NewDeadline;
                    }
                    break;
                }
            }

            if (indexOfSelectedTask == -1)
            {
                _logger.ForContext("newTitle", e.NewTitle)
                .ForContext("newDeadline", e.NewDeadline)
                .Error("Something went wrong updating the UI with new title and/or deadline of task");
                MessageBox.Show("Sorry, something went wrong showing the updated task title and/or deadline", "Error",
                                MessageBoxButtons.OK);
            }
        }
コード例 #8
0
 private static void OnTaskChanged(object sender, TaskChangedEventArgs taskChangedEventArgs)
 {
     SendTaskChanged(taskChangedEventArgs, GlobalHost.ConnectionManager.GetHubContext <TasksHub>().Clients);
 }
コード例 #9
0
 protected virtual void OnTaskChanged(TaskChangedEventArgs e) => TaskChanged?.Invoke(this, e);
コード例 #10
0
 public virtual void OnTaskChanged(TaskChangedEventArgs e)
 {
 }
コード例 #11
0
 private void TaskChangedHandler(TaskChangedEventArgs e)
 {
     sampleViewModel.TaskSubject = e.Subject;
 }