public static IMessageActivity GetDeleteActivity(AlarmBotContext context, IEnumerable <Alarm> alarms, string title, string message)
        {
            StringBuilder sb = new StringBuilder();
            int           i  = 1;

            if (alarms.Any())
            {
                foreach (var alarm in alarms)
                {
                    sb.AppendLine($"{i++}. {alarm.Title} {alarm.Time.Value.ToString("f")}");
                }
            }
            else
            {
                sb.AppendLine("There are no alarms defined");
            }
            i = 1;
            return(ResponseHelpers.ReplyWithSuggestions(context,
                                                        title,
                                                        $"{message}\n\n{sb.ToString()}",
                                                        alarms.Select(alarm => $"{i++} {alarm.Title}").ToArray()));
        }
 public static void ReplyWithAddConfirmation(IBotContext context, Alarm alarm)
 {
     context.Reply(ResponseHelpers.ReplyWithSuggestions(context, $"Adding Alarm", $"{AlarmDescription(context, alarm)}\n\nDo you want to save this alarm?", YesNo));
 }
 public static void ReplyWithCancelReprompt(IBotContext context, Alarm alarm)
 {
     context.Reply(ResponseHelpers.ReplyWithSuggestions(context, $"Cancel alarm?", $"Please answer the question with a \"yes\" or \"no\" reply. Did you want to cancel the alarm?\n\n{AlarmDescription(context, alarm)}", YesNo));
 }
 public static void ReplyWithCancelPrompt(IBotContext context, Alarm alarm)
 {
     context.Reply(ResponseHelpers.ReplyWithSuggestions(context, "Cancel Alarm?", $"Did you want to cancel the alarm?\n\n{AlarmDescription(context, alarm)}", YesNo));
 }
Exemple #5
0
 public static async Task ReplyWithAddConfirmation(ITurnContext context, Alarm alarm)
 {
     await context.SendActivity(ResponseHelpers.ReplyWithSuggestions(context, $"Adding Alarm", $"{AlarmDescription(context, alarm)}\n\nDo you want to save this alarm?", YesNo));
 }
Exemple #6
0
 public static async Task ReplyWithCancelReprompt(ITurnContext context, Alarm alarm)
 {
     await context.SendActivity(ResponseHelpers.ReplyWithSuggestions(context, $"Cancel alarm?", $"Please answer the question with a \"yes\" or \"no\" reply. Did you want to cancel the alarm?\n\n{AlarmDescription(context, alarm)}", YesNo));
 }
Exemple #7
0
 public static async Task ReplyWithCancelPrompt(ITurnContext context, Alarm alarm)
 {
     await context.SendActivity(ResponseHelpers.ReplyWithSuggestions(context, "Cancel Alarm?", $"Did you want to cancel the alarm?\n\n{AlarmDescription(context, alarm)}", YesNo));
 }