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, CancellationToken token) { var result = await item; if (result != null) { throw new ArgumentException(nameof(item)); } await this.start(task.makeContext(token)); return(task.NextWait()); }
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, CancellationToken token) { await this.resume(task.makeContext(token), item); return(task.NextWait()); }