public void ClearAllBindings(SwitchPanelPZ55KeyOnOff switchPanelPZ55KeyOnOff)
 {
     //This must accept lists
     foreach (var keyBinding in _keyBindings)
     {
         if (keyBinding.SwitchPanelPZ55Key == switchPanelPZ55KeyOnOff.SwitchPanelPZ55Key && keyBinding.WhenTurnedOn == switchPanelPZ55KeyOnOff.On)
         {
             keyBinding.OSKeyPress = null;
         }
     }
     foreach (var dcsBiosBinding in _dcsBiosBindings)
     {
         if (dcsBiosBinding.SwitchPanelPZ55Key == switchPanelPZ55KeyOnOff.SwitchPanelPZ55Key && dcsBiosBinding.WhenTurnedOn == switchPanelPZ55KeyOnOff.On)
         {
             dcsBiosBinding.DCSBIOSInputs.Clear();
         }
     }
     Common.DebugP("SwitchPanelPZ55 _keyBindings : " + _keyBindings.Count);
     Common.DebugP("SwitchPanelPZ55 _dcsBiosBindings : " + _dcsBiosBindings.Count);
     IsDirtyMethod();
 }
        public void AddOrUpdateSingleKeyBinding(SwitchPanelPZ55Keys switchPanelPZ55Key, string keys, KeyPressLength keyPressLength, bool whenTurnedOn = true)
        {
            if (string.IsNullOrEmpty(keys))
            {
                var tmp = new SwitchPanelPZ55KeyOnOff(switchPanelPZ55Key, whenTurnedOn);
                ClearAllBindings(tmp);
                return;
            }
            var found = false;

            foreach (var keyBinding in _keyBindings)
            {
                if (keyBinding.SwitchPanelPZ55Key == switchPanelPZ55Key && keyBinding.WhenTurnedOn == whenTurnedOn)
                {
                    if (string.IsNullOrEmpty(keys))
                    {
                        keyBinding.OSKeyPress = null;
                    }
                    else
                    {
                        keyBinding.OSKeyPress   = new OSKeyPress(keys, keyPressLength);
                        keyBinding.WhenTurnedOn = whenTurnedOn;
                    }
                    found = true;
                }
            }
            if (!found && !string.IsNullOrEmpty(keys))
            {
                var keyBinding = new KeyBindingPZ55();
                keyBinding.SwitchPanelPZ55Key = switchPanelPZ55Key;
                keyBinding.OSKeyPress         = new OSKeyPress(keys, keyPressLength);
                keyBinding.WhenTurnedOn       = whenTurnedOn;
                _keyBindings.Add(keyBinding);
            }
            Common.DebugP("SwitchPanelPZ55 _keyBindings : " + _keyBindings.Count);
            IsDirtyMethod();
        }