public void StopTask() { if (AppConstants.TokenSource != null) { TaskHub.TaskUpdate($"Cancel Tasks requested"); AppConstants.TokenSource.Cancel(); } }
public void StartTask() { AppConstants.TokenSource = new CancellationTokenSource(); for (int i = 0; i < 20; i++) { if (!AppConstants.TokenSource.Token.IsCancellationRequested) { TaskHub.TaskUpdate($"Loop:{i}"); Thread.Sleep(2000); } else { TaskHub.TaskUpdate($"Loop stopped"); break; } } }
private ContentResult Send(SendForm form, int?ProjectId, int?TaskId, int?TeamId, int?EmployeeId) { if (ModelState.IsValid) { int MyId = SessionUser.GetUser().Id; int?newMessageId = MessageService.Create(new C.Message(form.Title, form.Message, MyId, form.ReplyTo), EmployeeId, ProjectId, TaskId, TeamId); if (newMessageId != null) { if (EmployeeId != null) { EmployeeHub.Send((int)EmployeeId); MailboxHub.Send((int)EmployeeId); } else { if (form.ReplyTo != null) { int ParentAuthor = MessageService.Get((int)form.ReplyTo).Author; MailboxHub.Send(ParentAuthor); } if (ProjectId != null) { ProjectHub.Send((int)ProjectId); } else if (TaskId != null) { TaskHub.Send((int)TaskId); } else if (TeamId != null) { TeamHub.Send((int)TeamId); } } return(new ContentResult { Content = "success" }); } } return(new ContentResult { Content = "fail" }); }
public OrchestrationExpander(TaskHub taskHub, string executionId) { this.taskHub = taskHub; this.executionId = executionId; }
public OrchestrationFinder(TaskHub taskHub) { this.taskHub = taskHub; }