Exemplo n.º 1
0
 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()));
 }
Exemplo n.º 2
0
        protected override Task MessageReceivedAsync(IDialogContext context, IAwaitable <IMessageActivity> message)
        {
            if (!(context is TranslatingDialogContext))
            {
                context = new TranslatingDialogContext(context);
            }

            return(base.MessageReceivedAsync(context, message));
        }
Exemplo n.º 3
0
            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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 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)");
     }
 }
Exemplo n.º 7
0
        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);
 }