예제 #1
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("MultiPanelKnob{"))
             {
                 var knobBinding = new KnobBindingPZ70();
                 knobBinding.ImportSettings(setting);
                 _knobBindings.Add(knobBinding);
             }
             else if (setting.StartsWith("MultiPanelDCSBIOSControl{"))
             {
                 var dcsBIOSBindingPZ70 = new DCSBIOSBindingPZ70();
                 dcsBIOSBindingPZ70.ImportSettings(setting);
                 _dcsBiosBindings.Add(dcsBIOSBindingPZ70);
             }
             else if (setting.StartsWith("MultiPanelDCSBIOSControlLCD{"))
             {
                 var dcsBIOSBindingLCDPZ70 = new DCSBIOSBindingLCDPZ70();
                 dcsBIOSBindingLCDPZ70.ImportSettings(setting);
                 _dcsBiosLcdBindings.Add(dcsBIOSBindingLCDPZ70);
             }
         }
     }
     OnSettingsApplied();
 }
예제 #2
0
        public void AddOrUpdateDCSBIOSBinding(MultiPanelPZ70Knobs multiPanelPZ70Knob, List <DCSBIOSInput> dcsbiosInputs, string description, bool whenTurnedOn = true)
        {
            //This must accept lists
            var found = false;

            RemoveMultiPanelKnobFromList(1, multiPanelPZ70Knob, whenTurnedOn);
            foreach (var dcsBiosBinding in _dcsBiosBindings)
            {
                if (dcsBiosBinding.MultiPanelPZ70Knob == multiPanelPZ70Knob && dcsBiosBinding.WhenTurnedOn == whenTurnedOn)
                {
                    dcsBiosBinding.DCSBIOSInputs = dcsbiosInputs;
                    dcsBiosBinding.WhenTurnedOn  = whenTurnedOn;
                    dcsBiosBinding.Description   = description;
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                var dcsBiosBinding = new DCSBIOSBindingPZ70();
                dcsBiosBinding.MultiPanelPZ70Knob = multiPanelPZ70Knob;
                dcsBiosBinding.DCSBIOSInputs      = dcsbiosInputs;
                dcsBiosBinding.WhenTurnedOn       = whenTurnedOn;
                dcsBiosBinding.Description        = description;
                _dcsBiosBindings.Add(dcsBiosBinding);
            }
            IsDirtyMethod();
        }