diff --git a/MobiFlight/MobiFlightModule.cs b/MobiFlight/MobiFlightModule.cs index 76330df0..bd082f97 100644 --- a/MobiFlight/MobiFlightModule.cs +++ b/MobiFlight/MobiFlightModule.cs @@ -247,7 +247,12 @@ public MobiFlightModule(MobiFlightModuleInfo moduleInfo) Board = moduleInfo.Board; HardwareId = moduleInfo.HardwareId; } - + public object Clone() + { + var clone = new MobiFlightModule(this.ToMobiFlightModuleInfo()); + clone.CoreVersion = this.CoreVersion; + return clone; + } public void Connect() { if (this.Connected) diff --git a/UI/Panels/Settings/MobiFlightPanel.cs b/UI/Panels/Settings/MobiFlightPanel.cs index 2226e8c3..671e03df 100644 --- a/UI/Panels/Settings/MobiFlightPanel.cs +++ b/UI/Panels/Settings/MobiFlightPanel.cs @@ -1282,8 +1282,7 @@ private MobiFlightModule getVirtualModuleFromTree() TreeNode moduleNode = getModuleNode(); if (moduleNode == null) return null; - var module = new MobiFlightModule((moduleNode.Tag as MobiFlightModule).ToMobiFlightModuleInfo()); - module.CoreVersion = (moduleNode.Tag as MobiFlightModule).CoreVersion; + var module = (moduleNode.Tag as MobiFlightModule).Clone() as MobiFlightModule; // Generate config MobiFlight.Config.Config newConfig = new MobiFlight.Config.Config(); @@ -1295,6 +1294,8 @@ private MobiFlightModule getVirtualModuleFromTree() return module; } + + /// /// Tell whether a device requires the presence of a MultiplexerDriver ///