protected virtual void OnTaskChanged(TaskChangedEventArgs e) { if (TaskChanged != null) { TaskChanged(this, e); } }
void INovaAlertServiceCallback.OnTaskChanged(TaskChangedEventArgs e) { if (this.MainController != null) { this.MainController.OnTaskChanged(e); } }
public TaskChangeModel(TaskChangedEventArgs taskChangeDetails) { Contract.Requires(taskChangeDetails != null); this.Task = new TaskModel(taskChangeDetails.Task); this.ChangeType = taskChangeDetails.ChangeType; }
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; } }
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)); } } }
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(); }
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); } }
private static void OnTaskChanged(object sender, TaskChangedEventArgs taskChangedEventArgs) { SendTaskChanged(taskChangedEventArgs, GlobalHost.ConnectionManager.GetHubContext <TasksHub>().Clients); }
protected virtual void OnTaskChanged(TaskChangedEventArgs e) => TaskChanged?.Invoke(this, e);
public virtual void OnTaskChanged(TaskChangedEventArgs e) { }
private void TaskChangedHandler(TaskChangedEventArgs e) { sampleViewModel.TaskSubject = e.Subject; }