コード例 #1
0
        protected virtual bool OnValidateShortcut(Keys shortcut)
        {
            bool result = true;

            EventHandler <KeyboardShortcutValidationEventArgs> handler = ValidateShortcut;

            if (handler != null)
            {
                foreach (Delegate currentHandler in handler.GetInvocationList())
                {
                    KeyboardShortcutValidationEventArgs args = new KeyboardShortcutValidationEventArgs(shortcut);
                    currentHandler.DynamicInvoke(this, args);

                    result &= args.IsValid;
                    if (!result)
                    {
                        break;
                    }
                }
            }

            return(result);
        }
コード例 #2
0
        protected virtual bool OnValidateShortcut(Keys shortcut)
        {
            bool result = true;

            EventHandler<KeyboardShortcutValidationEventArgs> handler = ValidateShortcut;
            if (handler != null)
            {
                foreach (Delegate currentHandler in handler.GetInvocationList())
                {
                    KeyboardShortcutValidationEventArgs args = new KeyboardShortcutValidationEventArgs(shortcut);
                    currentHandler.DynamicInvoke(this, args);

                    result &= args.IsValid;
                    if (!result)
                    {
                        break;
                    }
                }
            }

            return result;
        }
コード例 #3
0
 private void kbdSecondaryShortcut_ValidateShortcut(object sender, KeyboardShortcutValidationEventArgs e)
 {
     e.IsValid = IsKeyboardShortcutValid(e.Keys);
 }
コード例 #4
0
 private void kbdSecondaryShortcut_ValidateShortcut(object sender, KeyboardShortcutValidationEventArgs e)
 {
     e.IsValid = IsKeyboardShortcutValid(e.Keys);
 }