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("TPMPanelDCSBIOSControl{")) { var dcsBIOSBindingTPM = new DCSBIOSBindingTPM(); dcsBIOSBindingTPM.ImportSettings(setting); _dcsBiosBindings.Add(dcsBIOSBindingTPM); } } } OnSettingsApplied(); }
public void AddOrUpdateDCSBIOSBinding(TPMPanelSwitches tpmPanelSwitch, List <DCSBIOSInput> dcsbiosInputs, string description, bool whenTurnedOn = true) { //!!!!!!! //If all DCS-BIOS commands has been deleted then provide a empty list, not null object!!! //This must accept lists var found = false; RemoveTPMPanelSwitchFromList(1, tpmPanelSwitch, whenTurnedOn); foreach (var dcsBiosBinding in _dcsBiosBindings) { if (dcsBiosBinding.TPMSwitch == tpmPanelSwitch && dcsBiosBinding.WhenTurnedOn == whenTurnedOn) { dcsBiosBinding.DCSBIOSInputs = dcsbiosInputs; dcsBiosBinding.WhenTurnedOn = whenTurnedOn; dcsBiosBinding.Description = description; found = true; break; } } if (!found) { var dcsBiosBinding = new DCSBIOSBindingTPM(); dcsBiosBinding.TPMSwitch = tpmPanelSwitch; dcsBiosBinding.DCSBIOSInputs = dcsbiosInputs; dcsBiosBinding.WhenTurnedOn = whenTurnedOn; dcsBiosBinding.Description = description; _dcsBiosBindings.Add(dcsBiosBinding); } IsDirtyMethod(); }
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 DCSBIOSBindingTPM(); 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); OnSettingsApplied(); }