public new static void Choice <T>(IDialogContext context, ResumeAfter <T> resume, IEnumerable <T> options, string prompt, string retry = null, int attempts = 3, PromptStyle promptStyle = PromptStyle.Auto, IEnumerable <string> descriptions = null) { if (!(context is TranslatingDialogContext)) { context = new TranslatingDialogContext(context); } Choice(context, resume, new PromptOptions <T>(prompt, retry, attempts: attempts, options: options.ToList(), promptStyler: new PromptStyler(promptStyle), descriptions: descriptions?.ToList())); }
protected override Task MessageReceivedAsync(IDialogContext context, IAwaitable <IMessageActivity> message) { if (!(context is TranslatingDialogContext)) { context = new TranslatingDialogContext(context); } return(base.MessageReceivedAsync(context, message)); }
public async Task ResumeReplace(IDialogContext outerContext, IAwaitable <T> result) { if (!(outerContext is TranslatingDialogContext)) { outerContext = new TranslatingDialogContext(outerContext); } await _outerResumer(outerContext, result); }
protected override async Task MessageReceived(IDialogContext context, IAwaitable <IMessageActivity> item) { if (!(context is TranslatingDialogContext)) { context = new TranslatingDialogContext(context); } await base.MessageReceived(context, item); }
public new static void Choice <T>(IDialogContext context, ResumeAfter <T> resume, PromptOptions <T> promptOptions) { if (!(context is TranslatingDialogContext)) { context = new TranslatingDialogContext(context); } var child = new EditablePromptChoice <T>(promptOptions); var cp = new ResumeReplacer <T>(resume); context.Call <T>(child, cp.ResumeReplace); }
async Task IDialog <object> .StartAsync(IDialogContext context) { try { var translatingContext = new TranslatingDialogContext(context); await base.StartAsync(translatingContext); } catch (Exception e) { _telemetry.TrackException(e); _telemetry.TrackTrace("Exception in EvenLuisModel.StartAsync (propagated)"); } }
protected async override Task MessageReceived(IDialogContext context, IAwaitable <IMessageActivity> item) { try { if (!(context is TranslatingDialogContext)) { context = new TranslatingDialogContext(context); } var activity = (Activity)await item; _resumptionCookie = new ResumptionCookie(activity); await base.MessageReceived(context, item); } catch (Exception ex) { _telemetry.TrackException(ex); } }
async Task IDialog <object> .StartAsync(IDialogContext context) { var translatingContext = new TranslatingDialogContext(context); await base.StartAsync(translatingContext); }