Пример #1
0
        private async Task ResumeAferChildDialogDone(IDialogContext context, IAwaitable <ChildDialogModel> result)
        {
            var childDialogModel = await result;

            if (childDialogModel.Success)
            {
                await context.Complete(childDialogModel.Message).ConfigureAwait(false);
            }
            else
            {
                await context.Complete().ConfigureAwait(false);
            }
        }
Пример #2
0
 public async Task AnswerBasedOnContext(IDialogContext context, string forecast)
 {
     if (dialogType == DialogType.rain && forecast.Contains("rain"))
     {
         await context.Complete("Yes, " + forecast);
     }
     else if (dialogType == DialogType.rain && !forecast.Contains("rain"))
     {
         await context.Complete("No, " + forecast);
     }
     else if (dialogType == DialogType.nice && forecast.Contains("clear"))
     {
         await context.Complete("Yes, " + forecast);
     }
     else if (dialogType == DialogType.nice && !forecast.Contains("clear"))
     {
         await context.Complete("No, " + forecast);
     }
     else
     {
         await context.Complete("It looks like it is " + forecast);
     }
 }
Пример #3
0
        private async Task Done(IDialogContext context, string message = null)
        {
            message = string.IsNullOrWhiteSpace(message) ? string.Empty : message;

            if (!_isChild)
            {
                if (!string.IsNullOrWhiteSpace(message))
                {
                    await context.Complete(message);
                }
                else
                {
                    await context.Complete();
                }
            }
            else
            {
                context.Done(new ChildDialogModel
                {
                    Success = !string.IsNullOrWhiteSpace(message),
                    Message = message
                });
            }
        }
Пример #4
0
 public Task None(IDialogContext context, IAwaitable <IMessageActivity> message, LuisResult luisResult)
 {
     return(context.Complete("Don't know what you are talking about"));
 }