/// <summary> /// Callback for event that enables feature. Disables feature /// </summary> /// <param name="SchEvent"></param> /// <param name="type"></param> void FeatureDisableEvent_UserCallBack(ScheduledEvent SchEvent, ScheduledEventCommon.eCallbackReason type) { if (type == ScheduledEventCommon.eCallbackReason.NormalExpiration) { FeatureEnabled = false; Debug.Console(1, this, "RoomOnToDefaultSourceWhenOccupied Feature Disabled."); } }
/// <summary> /// Callback for event that enables feature. Enables feature if config property is true /// </summary> /// <param name="SchEvent"></param> /// <param name="type"></param> void FeatureEnableEvent_UserCallBack(ScheduledEvent SchEvent, ScheduledEventCommon.eCallbackReason type) { if (type == ScheduledEventCommon.eCallbackReason.NormalExpiration) { if (PropertiesConfig.EnableRoomOnWhenOccupied) { FeatureEnabled = true; } Debug.Console(1, this, "RoomOnToDefaultSourceWhenOccupied Feature Enabled."); } }
void myEvent1_UserCallBack(ScheduledEvent SchEvent, ScheduledEventCommon.eCallbackReason type) { if (SchEvent.Name == "Relay 1") { CrestronConsole.PrintLine("Hitting Relay 1, {0}", DateTime.Now.ToString()); RelayEvent(1); } else if (SchEvent.Name == "Relay 2") { CrestronConsole.PrintLine("Hitting Relay 2, {0}", DateTime.Now.ToString()); CrestronConsole.PrintLine("Snooze Result: {0}", SchEvent.Snooze(2).ToString()); RelayEvent(2); } }
void Scheduler_UserCallBack(ScheduledEvent SchEvent, ScheduledEventCommon.eCallbackReason type) { if (SchEvent.Name == "Relay 1") { CrestronConsole.PrintLine("{0} == Relay 1 Clicked", DateTime.Now.ToString()); RelayEvent(1); } if (SchEvent.Name == "Relay 2") { CrestronConsole.PrintLine("{0} == Relay 2 Clicked", DateTime.Now.ToString()); CrestronConsole.PrintLine("Snooze Result: {0}", SchEvent.Snooze(2).ToString()); RelayEvent(2); } }
void FeatureEventGroup_UserGroupCallBack(ScheduledEvent SchEvent, ScheduledEventCommon.eCallbackReason type) { if (type == ScheduledEventCommon.eCallbackReason.NormalExpiration) { if (SchEvent.Name == FeatureEnableEventName) { if (PropertiesConfig.EnableRoomOnWhenOccupied) { FeatureEnabled = true; } Debug.Console(1, this, "*****Feature Enabled by event.*****"); } else if (SchEvent.Name == FeatureDisableEventName) { FeatureEnabled = false; Debug.Console(1, this, "*****Feature Disabled by event.*****"); } } }
public void callback(ScheduledEvent e, ScheduledEventCommon.eCallbackReason r) { CrestronConsole.PrintLine("scheduler at:{0}", DateTime.Now.ToString()); string fileName = "\\NVRAM\\" + this.hostID + "_" + this.schdulerID + ".plist"; var xml = new SceneXML(); string deviceinfo = xml.parseSceneToDevices(fileName); if (e.Name == "scene" + this.schdulerID || e.Name == "device" + this.schdulerID) { if (openit != null) { openit(deviceinfo); } } if (e.Name == "e_scene" + this.schdulerID || e.Name == "e_device" + this.schdulerID) { if (openit != null) { closeit(deviceinfo); } } }
void myEvent_UserCallBack(ScheduledEvent SchEvent, ScheduledEventCommon.eCallbackReason type) { CrestronConsole.PrintLine("Event {0}, triggered @ {1}:{2}", SchEvent.Name, SchEvent.DateAndTime.Hour.ToString(), SchEvent.DateAndTime.Minute.ToString()); }