Exemplo n.º 1
0
        public void AddOrUpdateSequencedKeyBinding(string information, MultiPanelPZ70Knobs multiPanelPZ70Knob, SortedList <int, KeyPressInfo> sortedList, bool whenTurnedOn = true)
        {
            //This must accept lists
            var found = false;

            RemoveMultiPanelKnobFromList(2, multiPanelPZ70Knob, whenTurnedOn);
            foreach (var knobBinding in _knobBindings)
            {
                if (knobBinding.MultiPanelPZ70Knob == multiPanelPZ70Knob && knobBinding.WhenTurnedOn == whenTurnedOn)
                {
                    if (sortedList.Count == 0)
                    {
                        knobBinding.OSKeyPress = null;
                    }
                    else
                    {
                        knobBinding.OSKeyPress   = new OSKeyPress(information, sortedList);
                        knobBinding.WhenTurnedOn = whenTurnedOn;
                    }
                    found = true;
                    break;
                }
            }
            if (!found && sortedList.Count > 0)
            {
                var knobBinding = new KnobBindingPZ70();
                knobBinding.MultiPanelPZ70Knob = multiPanelPZ70Knob;
                knobBinding.OSKeyPress         = new OSKeyPress(information, sortedList);
                knobBinding.WhenTurnedOn       = whenTurnedOn;
                _knobBindings.Add(knobBinding);
            }
            IsDirtyMethod();
        }
Exemplo n.º 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("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();
 }
Exemplo n.º 3
0
        public void AddOrUpdateSingleKeyBinding(MultiPanelPZ70Knobs multiPanelPZ70Knob, string keys, KeyPressLength keyPressLength, bool whenTurnedOn = true)
        {
            //This must accept lists
            var found = false;

            foreach (var knobBinding in _knobBindings)
            {
                if (knobBinding.MultiPanelPZ70Knob == multiPanelPZ70Knob && knobBinding.WhenTurnedOn == whenTurnedOn)
                {
                    if (string.IsNullOrEmpty(keys))
                    {
                        knobBinding.OSKeyPress = null;
                    }
                    else
                    {
                        knobBinding.OSKeyPress   = new OSKeyPress(keys, keyPressLength);
                        knobBinding.WhenTurnedOn = whenTurnedOn;
                    }
                    found = true;
                }
            }
            if (!found && !string.IsNullOrEmpty(keys))
            {
                var knobBinding = new KnobBindingPZ70();
                knobBinding.MultiPanelPZ70Knob = multiPanelPZ70Knob;
                knobBinding.OSKeyPress         = new OSKeyPress(keys, keyPressLength);
                knobBinding.WhenTurnedOn       = whenTurnedOn;
                _knobBindings.Add(knobBinding);
            }
            Common.DebugP("MultiPanelPZ70 _knobBindings : " + _knobBindings.Count);
            IsDirtyMethod();
        }