From 01b713e6e1af7181a6efe6c2666d3b67dbcf9504 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 16 Aug 2021 14:27:28 -0600 Subject: [PATCH] feat(essentials): Adds IMobileControl3 interface to maintain backwards compatibility --- PepperDashEssentials/ControlSystem.cs | 19 ++++++++++++++----- .../DeviceTypeInterfaces/IMobileControl.cs | 8 ++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index 2495340c..ef1a9378 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -484,7 +484,7 @@ namespace PepperDash.Essentials Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge..."); - CreateMobileControlBridge(room as EssentialsRoomBase); + CreateMobileControlBridge(room); } else if (room is IEssentialsHuddleVtc1Room) { @@ -495,7 +495,7 @@ namespace PepperDash.Essentials Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge..."); - CreateMobileControlBridge(room as EssentialsRoomBase); + CreateMobileControlBridge(room); } else if (room is EssentialsTechRoom) { @@ -507,7 +507,7 @@ namespace PepperDash.Essentials Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge"); - CreateMobileControlBridge(room as EssentialsRoomBase); + CreateMobileControlBridge(room); } else { @@ -524,13 +524,22 @@ namespace PepperDash.Essentials } - private static void CreateMobileControlBridge(EssentialsRoomBase room) + private static void CreateMobileControlBridge(object room) { var mobileControl = GetMobileControlDevice(); if (mobileControl == null) return; - mobileControl.CreateMobileControlRoomBridge(room, mobileControl); + var mobileControl3 = mobileControl as IMobileControl3; + + if (mobileControl3 != null) + { + mobileControl3.CreateMobileControlRoomBridge(room as IEssentialsRoom, mobileControl); + } + else + { + mobileControl.CreateMobileControlRoomBridge(room as EssentialsRoomBase, mobileControl); + } Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control Bridge Added..."); } diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs index c87e7865..ba9e6609 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs @@ -13,6 +13,14 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces void LinkSystemMonitorToAppServer(); } + /// + /// Describes a MobileSystemController that accepts IEssentialsRoom + /// + public interface IMobileControl3 : IMobileControl + { + void CreateMobileControlRoomBridge(IEssentialsRoom room, IMobileControl parent); + } + /// /// Describes a MobileControl Room Bridge ///