コード例 #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 AddOrUpdateDCSBIOSLcdBinding(MultiPanelPZ70Knobs multiPanelPZ70Knob, DCSBIOSOutputFormula dcsbiosOutputFormula, PZ70LCDPosition pz70LCDPosition)
        {
            var found = false;

            foreach (var dcsBiosBindingLCD in _dcsBiosLcdBindings)
            {
                if (dcsBiosBindingLCD.MultiPanelPZ70Knob == multiPanelPZ70Knob && dcsBiosBindingLCD.PZ70LCDPosition == pz70LCDPosition)
                {
                    dcsBiosBindingLCD.DCSBIOSOutputFormulaObject = dcsbiosOutputFormula;
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                var dcsBiosBindingLCD = new DCSBIOSBindingLCDPZ70();
                dcsBiosBindingLCD.MultiPanelPZ70Knob         = multiPanelPZ70Knob;
                dcsBiosBindingLCD.DCSBIOSOutputFormulaObject = dcsbiosOutputFormula;
                dcsBiosBindingLCD.PZ70LCDPosition            = pz70LCDPosition;
                _dcsBiosLcdBindings.Add(dcsBiosBindingLCD);
            }
            IsDirtyMethod();
        }