public override void ImportSettings(GenericPanelBinding genericPanelBinding)
        {
            ClearSettings();

            BindingHash = genericPanelBinding.BindingHash;

            var settings = genericPanelBinding.Settings;

            foreach (var setting in settings)
            {
                if (!setting.StartsWith("#") && setting.Length > 2)
                {
                    if (setting.StartsWith("SwitchPanelKey{"))
                    {
                        var keyBinding = new KeyBindingPZ55();
                        keyBinding.ImportSettings(setting);
                        _keyBindings.Add(keyBinding);
                    }
                    else if (setting.StartsWith("SwitchPanelOSPZ55"))
                    {
                        var osCommand = new OSCommandBindingPZ55();
                        osCommand.ImportSettings(setting);
                        _osCommandBindings.Add(osCommand);
                    }
                    else if (setting.StartsWith("SwitchPanelLed"))
                    {
                        var colorOutput = new DcsOutputAndColorBindingPZ55();
                        colorOutput.ImportSettings(setting);
                        _listColorOutputBinding.Add(colorOutput);
                    }
                    else if (setting.StartsWith("SwitchPanelDCSBIOSControl{"))
                    {
                        var dcsBIOSBindingPZ55 = new DCSBIOSActionBindingPZ55();
                        dcsBIOSBindingPZ55.ImportSettings(setting);
                        _dcsBiosBindings.Add(dcsBIOSBindingPZ55);
                    }
                    else if (setting.StartsWith("SwitchPanelBIPLink{"))
                    {
                        var bipLinkPZ55 = new BIPLinkPZ55();
                        bipLinkPZ55.ImportSettings(setting);
                        _bipLinks.Add(bipLinkPZ55);
                    }
                    else if (setting.StartsWith("ManualLandingGearLEDs{"))
                    {
                        _manualLandingGearLeds = setting.Contains("True");
                    }
                }
            }

            SettingsApplied();
            _keyBindings = KeyBindingPZ55.SetNegators(_keyBindings);
        }
Beispiel #2
0
 public override void ImportSettings(List <string> settings)
 {
     //Clear current bindings
     ClearSettings();
     if (settings == null || settings.Count == 0)
     {
         return;
     }
     foreach (var setting in settings)
     {
         if (!setting.StartsWith("#") && setting.Length > 2 && setting.Contains(InstanceId))
         {
             if (setting.StartsWith("SwitchPanelKey{"))
             {
                 var keyBinding = new KeyBindingPZ55();
                 keyBinding.ImportSettings(setting);
                 _keyBindings.Add(keyBinding);
             }
             else if (setting.StartsWith("SwitchPanelOSPZ55"))
             {
                 var osCommand = new OSCommandBindingPZ55();
                 osCommand.ImportSettings(setting);
                 _osCommandBindings.Add(osCommand);
             }
             else if (setting.StartsWith("SwitchPanelLed"))
             {
                 var colorOutput = new DcsOutputAndColorBindingPZ55();
                 colorOutput.ImportSettings(setting);
                 _listColorOutputBinding.Add(colorOutput);
             }
             else if (setting.StartsWith("SwitchPanelDCSBIOSControl{"))
             {
                 var dcsBIOSBindingPZ55 = new DCSBIOSActionBindingPZ55();
                 dcsBIOSBindingPZ55.ImportSettings(setting);
                 _dcsBiosBindings.Add(dcsBIOSBindingPZ55);
             }
             else if (setting.StartsWith("SwitchPanelBIPLink{"))
             {
                 var bipLinkPZ55 = new BIPLinkPZ55();
                 bipLinkPZ55.ImportSettings(setting);
                 _bipLinks.Add(bipLinkPZ55);
             }
             else if (setting.StartsWith("ManualLandingGearLEDs{"))
             {
                 _manualLandingGearLeds = setting.Contains("True");
             }
         }
     }
     SettingsApplied();
     _keyBindings = KeyBindingPZ55.SetNegators(_keyBindings);
 }