diff --git a/4-series/epi-essentials-mobile-control/Touchpanel/MobileControlTouchpanelController.cs b/4-series/epi-essentials-mobile-control/Touchpanel/MobileControlTouchpanelController.cs index 1313bf1..0b77a0e 100644 --- a/4-series/epi-essentials-mobile-control/Touchpanel/MobileControlTouchpanelController.cs +++ b/4-series/epi-essentials-mobile-control/Touchpanel/MobileControlTouchpanelController.cs @@ -141,13 +141,13 @@ public MobileControlTouchpanelController(string key, string name, BasicTriListWi public void UpdateTheme(string theme) { - localConfig.Theme = theme; - + localConfig.Theme = theme; + var props = JToken.FromObject(localConfig); var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault((d) => d.Key == Key); - if(deviceConfig == null) { return; } + if (deviceConfig == null) { return; } deviceConfig.Properties = props; @@ -155,7 +155,7 @@ public void UpdateTheme(string theme) } private void RegisterForExtenders() - { + { if (Panel is TswXX70Base x70Panel) { x70Panel.ExtenderApplicationControlReservedSigs.DeviceExtenderSigChange += (e, a) => @@ -168,13 +168,14 @@ private void RegisterForExtenders() { x70Panel.ExtenderButtonToolbarReservedSigs.ShowButtonToolbar(); x70Panel.ExtenderButtonToolbarReservedSigs.Button2On(); - } else + } + else { x70Panel.ExtenderButtonToolbarReservedSigs.HideButtonToolbar(); x70Panel.ExtenderButtonToolbarReservedSigs.Button2Off(); } }; - + x70Panel.ExtenderZoomRoomAppReservedSigs.DeviceExtenderSigChange += (e, a) => { @@ -189,7 +190,7 @@ private void RegisterForExtenders() ZoomInCallFeedback.FireUpdate(); } }; - + x70Panel.ExtenderEthernetReservedSigs.DeviceExtenderSigChange += (e, a) => { @@ -200,7 +201,7 @@ private void RegisterForExtenders() var handler = DeviceInfoChanged; - if(handler == null) + if (handler == null) { return; } @@ -248,7 +249,7 @@ private void RegisterForExtenders() }; x60withZoomApp.ExtenderEthernetReservedSigs.DeviceExtenderSigChange += (e, a) => - { + { DeviceInfo.MacAddress = x60withZoomApp.ExtenderEthernetReservedSigs.MacAddressFeedback.StringValue; DeviceInfo.IpAddress = x60withZoomApp.ExtenderEthernetReservedSigs.IpAddressFeedback.StringValue; @@ -272,10 +273,6 @@ private void RegisterForExtenders() public override bool CustomActivate() { - if (!(Panel is TswXX70Base) && !(Panel is TswX60WithZoomRoomAppReservedSigs)) - { - return base.CustomActivate(); - } var appMessenger = new ITswAppControlMessenger($"appControlMessenger-{Key}", $"/device/{Key}", this); var zoomMessenger = new ITswZoomControlMessenger($"zoomControlMessenger-{Key}", $"/device/{Key}", this); @@ -289,6 +286,13 @@ public override bool CustomActivate() return base.CustomActivate(); } + if (!(Panel is TswXX70Base) && !(Panel is TswX60WithZoomRoomAppReservedSigs)) + { + mc.AddDeviceMessenger(themeMessenger); + + return base.CustomActivate(); + } + mc.AddDeviceMessenger(appMessenger); mc.AddDeviceMessenger(zoomMessenger); mc.AddDeviceMessenger(themeMessenger);