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("TPMPanelSwitch{")) { var keyBinding = new KeyBindingTPM(); keyBinding.ImportSettings(setting); _keyBindings.Add(keyBinding); } else if (setting.StartsWith("TPMPanelOSCommand")) { var osCommand = new OSCommandBindingTPM(); osCommand.ImportSettings(setting); _osCommandBindings.Add(osCommand); } else if (setting.StartsWith("TPMPanelDCSBIOSControl{")) { var dcsBIOSBindingTPM = new DCSBIOSActionBindingTPM(); dcsBIOSBindingTPM.ImportSettings(setting); _dcsBiosBindings.Add(dcsBIOSBindingTPM); } else if (setting.StartsWith("TPMPanelBipLink{")) { var tmpBipLink = new BIPLinkTPM(); tmpBipLink.ImportSettings(setting); _bipLinks.Add(tmpBipLink); } } } _keyBindings = KeyBindingTPM.SetNegators(_keyBindings); SettingsApplied(); }
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("TPMPanelSwitch{")) { var keyBinding = new KeyBindingTPM(); keyBinding.ImportSettings(setting); _keyBindings.Add(keyBinding); } else if (setting.StartsWith("TPMPanelOSCommand")) { var osCommand = new OSCommandBindingTPM(); osCommand.ImportSettings(setting); _osCommandBindings.Add(osCommand); } else if (setting.StartsWith("TPMPanelDCSBIOSControl{")) { var dcsBIOSBindingTPM = new DCSBIOSActionBindingTPM(); dcsBIOSBindingTPM.ImportSettings(setting); _dcsBiosBindings.Add(dcsBIOSBindingTPM); } else if (setting.StartsWith("TPMPanelBipLink{")) { var tmpBipLink = new BIPLinkTPM(); tmpBipLink.ImportSettings(setting); _bipLinks.Add(tmpBipLink); } } } _keyBindings = KeyBindingTPM.SetNegators(_keyBindings); SettingsApplied(); }