diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs index fb305172..e07ef496 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs @@ -24,6 +24,10 @@ namespace PepperDash.Essentials.Core CrestronConsole.AddNewConsoleCommand(ClearEventsFromGroup, "ClearAllEvents", "Clears all scheduled events for this group", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(ListAllEventGroups, "ListAllEventGroups", "Lists all the event groups by key", ConsoleAccessLevelEnum.AccessOperator); + + CrestronConsole.AddNewConsoleCommand(ListAllEventsForGroup, "ListEventsForGroup", + "Lists all events for the given group", ConsoleAccessLevelEnum.AccessOperator); + } /// @@ -49,6 +53,33 @@ namespace PepperDash.Essentials.Core } } + static void ListAllEventsForGroup(string args) + { + Debug.Console(0, "Getting events for group {0}...", args); + + ScheduledEventGroup group; + + if (!EventGroups.TryGetValue(args, out group)) + { + Debug.Console(0, "Unabled to get event group for key {0}", args); + return; + } + + foreach (var evt in group.ScheduledEvents) + { + Debug.Console(0, + @" +****Event key {0}**** +Event date/time: {1} +Persistent: {2} +Acknowlegable: {3} +Recurrence: {4} +Recurrence Days: {5} +********************", evt.Key, evt.Value.DateAndTime, evt.Value.Persistent, evt.Value.Acknowledgeable, + evt.Value.Recurrence.Recurrence, evt.Value.Recurrence.RecurrenceDays); + } + } + /// /// Adds the event group to the global list ///