コード例 #1
0
        public bool CheckIfHotkeyIsAlreadyInUse(GenericHotkeyProxy hotkeyProxy)
        {
            int  i            = 0;
            bool alreadyInUse = false;

            while (i < this.Hotkeys.Count && !alreadyInUse)
            {
                GenericHotkeyProxy genericHotkeyProxy = this.Hotkeys[i++];
                if (genericHotkeyProxy == hotkeyProxy)
                {
                    continue;
                }

                if (hotkeyProxy.IsAlreadyInUseBy(genericHotkeyProxy))
                {
                    hotkeyProxy.Hotkey.SetIsValid(false, $"Hotkey already in use by \"{genericHotkeyProxy.Hotkey.HumanReadableAction}\"");
                    alreadyInUse = true;
                }
            }

            return(alreadyInUse);
        }