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 ReplyWithAddedAlarm(IBotContext context, Alarm alarm)
 {
     context.Reply(ResponseHelpers.ReplyWithTitle(context, $"Alarm Added", $"{AlarmDescription(context, alarm)}."));
 }
 public static void ReplyWithTitleValidationPrompt(IBotContext context, Alarm alarm)
 {
     context.Reply(ResponseHelpers.ReplyWithTitle(context, $"Adding alarm", $"Your title needs to be between 1 and 100 characterslong\n\n{AlarmDescription(context, alarm)}\n\nWhat would you like to call your alarm ?"));
 }
 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 ReplyWithTimePromptFuture(IBotContext context, Alarm alarm)
 {
     context.Reply(ResponseHelpers.ReplyWithTitle(context, $"Adding alarm", $"{AlarmDescription(context, alarm)}\n\nYou need to specify a time in the future. What time would you like to set the alarm?"));
 }
 public static void ReplyWithTitlePrompt(IBotContext context, Alarm alarm)
 {
     context.Reply(ResponseHelpers.ReplyWithTitle(context, $"Adding alarm", $"{AlarmDescription(context, alarm)}\n\nWhat would you like to call your alarm ?"));
 }
 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));
 }
 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));
 }
Exemplo n.º 9
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));
 }
Exemplo n.º 10
0
 public static async Task ReplyWithAddedAlarm(ITurnContext context, Alarm alarm)
 {
     await context.SendActivity(ResponseHelpers.ReplyWithTitle(context, $"Alarm Added", $"{AlarmDescription(context, alarm)}."));
 }
Exemplo n.º 11
0
 public static async Task ReplyWithTitleValidationPrompt(ITurnContext context, Alarm alarm)
 {
     await context.SendActivity(ResponseHelpers.ReplyWithTitle(context, $"Adding alarm", $"Your title needs to be between 1 and 100 characterslong\n\n{AlarmDescription(context, alarm)}\n\nWhat would you like to call your alarm ?"));
 }
Exemplo n.º 12
0
 public static async Task ReplyWithTitlePrompt(ITurnContext context, Alarm alarm)
 {
     await context.SendActivity(ResponseHelpers.ReplyWithTitle(context, $"Adding alarm", $"{AlarmDescription(context, alarm)}\n\nWhat would you like to call your alarm ?"));
 }
Exemplo n.º 13
0
 public static async Task ReplyWithTimePromptFuture(ITurnContext context, Alarm alarm)
 {
     await context.SendActivity(ResponseHelpers.ReplyWithTitle(context, $"Adding alarm", $"{AlarmDescription(context, alarm)}\n\nYou need to specify a time in the future. What time would you like to set the alarm?"));
 }
Exemplo n.º 14
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));
 }
Exemplo n.º 15
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));
 }