diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/CalendarSkillState.cs b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/CalendarSkillState.cs index 426f15c903..e336732994 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/CalendarSkillState.cs +++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/CalendarSkillState.cs @@ -42,6 +42,7 @@ public CalendarSkillState() Duration = 0; MoveTimeSpan = 0; AskParameterContent = string.Empty; + RecurrencePattern = string.Empty; } public User User { get; set; } @@ -126,6 +127,8 @@ public CalendarSkillState() public string AskParameterContent { get; set; } + public string RecurrencePattern { get; set; } + public TimeZoneInfo GetUserTimeZone() { if ((UserInfo != null) && (UserInfo.Timezone != null)) @@ -170,6 +173,7 @@ public void Clear() Duration = 0; MoveTimeSpan = 0; AskParameterContent = string.Empty; + RecurrencePattern = string.Empty; } public class UserInformation diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/CalendarSkillDialog.cs b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/CalendarSkillDialog.cs index cf4470ad92..02ee9b95c3 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/CalendarSkillDialog.cs +++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/CalendarSkillDialog.cs @@ -6,8 +6,10 @@ using CalendarSkill.Common; using CalendarSkill.Dialogs.Main.Resources; using CalendarSkill.Dialogs.Shared.Resources; +using CalendarSkill.Dialogs.Shared.Resources.Strings; using Luis; using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.AI.Luis; using Microsoft.Bot.Builder.Dialogs; using Microsoft.Bot.Builder.Dialogs.Choices; using Microsoft.Bot.Schema; @@ -19,7 +21,6 @@ using Microsoft.Recognizers.Text.DateTime; using Newtonsoft.Json.Linq; using static Microsoft.Recognizers.Text.Culture; -using Microsoft.Bot.Builder.AI.Luis; namespace CalendarSkill { @@ -651,6 +652,17 @@ protected async Task DigestCalendarLuisResult(DialogContext dc, Calendar luisRes state.MoveTimeSpan = GetMoveTimeSpanFromEntity(entity.MoveLaterTimeSpan[0], dc.Context.Activity.Locale, true); } + if (entity.datetime != null) + { + var match = entity._instance.datetime.ToList().Find(w => w.Text.ToLower() == CalendarCommonStrings.DailyToken + || w.Text.ToLower() == CalendarCommonStrings.WeeklyToken + || w.Text.ToLower() == CalendarCommonStrings.MonthlyToken); + if (match != null) + { + state.RecurrencePattern = match.Text.ToLower(); + } + } + break; } diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.Designer.cs b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.Designer.cs index 994d839eb1..fcc96f6781 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.Designer.cs +++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.Designer.cs @@ -70,10 +70,39 @@ public static string AllDay { } /// - /// Looks up a localized string similar to with a subject of {0}. + /// Looks up a localized string similar to daily. + /// + public static string DailyToken { + get { + return ResourceManager.GetString("DailyToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to monthly. /// - public static string WithTheSubject { + public static string MonthlyToken { get { + return ResourceManager.GetString("MonthlyToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to weekly. + /// + public static string WeeklyToken { + get { + return ResourceManager.GetString("WeeklyToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to with a subject of {0}. + /// + public static string WithTheSubject + { + get + { return ResourceManager.GetString("WithTheSubject", resourceCulture); } } diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.de.resx b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.de.resx index 4df927e321..c2c29acacd 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.de.resx +++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.de.resx @@ -120,6 +120,15 @@ Den ganzen Tag + + Täglich + + + Monatliche + + + Wöchentliche + Mit einem Thema {0} diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.es.resx b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.es.resx index c3ad8d861c..462cf9652e 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.es.resx +++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.es.resx @@ -120,6 +120,15 @@ Todo el dia + + Diario + + + Mensual + + + Semanal + con un tema de {0} diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.fr.resx b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.fr.resx index 77f6ef21ab..668629afd9 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.fr.resx +++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.fr.resx @@ -120,6 +120,15 @@ Toute la journée + + Quotidienne + + + Mensuel + + + Hebdomadaire + avec un sujet de {0} diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.it.resx b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.it.resx index 07f71eaf34..5771a32a95 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.it.resx +++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.it.resx @@ -120,6 +120,15 @@ Tutto il giorno + + Quotidiana + + + Mensile + + + Settimanale + con un soggetto di {0} diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.resx b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.resx index e0df13aa9e..85f9f824af 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.resx +++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.resx @@ -120,6 +120,15 @@ All day + + daily + + + monthly + + + weekly + with a subject of {0} diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.zh.resx b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.zh.resx index 027b2ee67f..f8cac6f88a 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.zh.resx +++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/Shared/Resources/Strings/CalendarCommonStrings.zh.resx @@ -120,4 +120,16 @@ 全天 + + 每天 + + + 每月 + + + 每周 + + + 以{0}为标题 + \ No newline at end of file diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/UpdateEvent/UpdateEventDialog.cs b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/UpdateEvent/UpdateEventDialog.cs index e048070267..ad13d1465a 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/UpdateEvent/UpdateEventDialog.cs +++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Dialogs/UpdateEvent/UpdateEventDialog.cs @@ -137,6 +137,11 @@ public UpdateEventDialog( updateEvent.TimeZone = TimeZoneInfo.Utc; updateEvent.Id = origin.Id; + if (!string.IsNullOrEmpty(state.RecurrencePattern) && !string.IsNullOrEmpty(origin.RecurringId)) + { + updateEvent.Id = origin.RecurringId; + } + var calendarService = ServiceManager.InitCalendarService(state.APIToken, state.EventSource); var newEvent = await calendarService.UpdateEventById(updateEvent); diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Models/EventModel.cs b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Models/EventModel.cs index bdfe733011..76a34e91f7 100644 --- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Models/EventModel.cs +++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/Models/EventModel.cs @@ -185,6 +185,37 @@ public string Id } } + public string RecurringId + { + get + { + switch (source) + { + case EventSource.Microsoft: + return msftEventData.SeriesMasterId; + case EventSource.Google: + return gmailEventData.RecurringEventId; + default: + throw new Exception("Event Type not Defined"); + } + } + + set + { + switch (source) + { + case EventSource.Microsoft: + msftEventData.SeriesMasterId = value; + break; + case EventSource.Google: + gmailEventData.RecurringEventId = value; + break; + default: + throw new Exception("Event Type not Defined"); + } + } + } + public string Title { get