IDialogTask IDialogTasks.CreateDialogTask() { IDialogStack stack = default(IDialogStack); Func <CancellationToken, IDialogContext> makeContext = token => contextFactory(stack, token); var task = new DialogTask(makeContext, stackStoreFactory.StoreFrom(this.GetCurrentTaskBlobKey(this.dialogTasks.Count), botData.PrivateConversationData), this.queue); stack = task; dialogTasks.Add(task); return(task); }
public async Task <IWait <DialogTask> > Rest(IFiber <DialogTask> fiber, DialogTask task, IItem <object> item) { var result = await item; if (result != null) { throw new ArgumentException(nameof(item)); } await this.start(task.makeContext()); return(task.wait); }
public Frames(DialogTask task) { SetField.NotNull(out this.task, nameof(task), task); }
public async Task <IWait <DialogTask> > Rest(IFiber <DialogTask> fiber, DialogTask task, IItem <T> item) { await this.resume(task.makeContext(), item); return(task.wait); }
public async Task <IWait <DialogTask> > Rest(IFiber <DialogTask> fiber, DialogTask task, IItem <T> item, CancellationToken token) { await this.resume(task.makeContext(token), item); return(task.NextWait()); }