Esempio n. 1
0
		protected override void OnAccessKey (AccessKeyEventArgs e)
		{
			if (e == null)
				throw new NullReferenceException ();
			base.OnAccessKey (e);
			Focus ();
		}
Esempio n. 2
0
        protected override void OnAccessKey(swi.AccessKeyEventArgs e)
        {
            // move focus to the next control after the label
            var tRequest = new swi.TraversalRequest(swi.FocusNavigationDirection.Next);

            MoveFocus(tRequest);
        }
Esempio n. 3
0
        private ProcessKeyResult ProcessKey(List <IInputElement> targets, string key, bool existsElsewhere, bool userInitiated)
        {
            if (targets != null)
            {
                bool      oneUIElement    = true;
                UIElement invokeUIElement = null;
                bool      lastWasAccessed = false;

                int chosenIndex = 0;
                for (int i = 0; i < targets.Count; i++)
                {
                    UIElement target = targets[i] as UIElement;
                    Debug.Assert(target != null, "Targets should only be UIElements");
                    if (!target.IsEnabled)
                    {
                        continue;
                    }

                    if (invokeUIElement == null)
                    {
                        invokeUIElement = target;
                        chosenIndex     = i;
                    }
                    else
                    {
                        if (lastWasAccessed)
                        {
                            invokeUIElement = target;
                            chosenIndex     = i;
                        }

                        oneUIElement = false;
                    }

                    //
                    lastWasAccessed = target.HasEffectiveKeyboardFocus;
                }

                if (invokeUIElement != null)
                {
                    AccessKeyEventArgs args = new AccessKeyEventArgs(key, !oneUIElement || existsElsewhere /* == isMultiple */, userInitiated);
                    try
                    {
                        invokeUIElement.InvokeAccessKey(args);
                    }
                    finally
                    {
                        args.ClearUserInitiated();
                    }

                    return((chosenIndex == targets.Count - 1) ? ProcessKeyResult.LastMatch : ProcessKeyResult.MoreMatches);
                }
            }

            return(ProcessKeyResult.NoMatch);
        }
Esempio n. 4
0
        protected override void OnAccessKey(AccessKeyEventArgs e)
        {
            base.OnAccessKey(e);

            if (!e.IsMultiple)
            {
                MenuItemRole type = Role;

                switch (type)
                {
                    case MenuItemRole.TopLevelItem:
                    case MenuItemRole.SubmenuItem:
                        {
                            ClickItem(e.UserInitiated);
                        }
                        break;

                    case MenuItemRole.TopLevelHeader :
                    case MenuItemRole.SubmenuHeader :
                        {
                            OpenSubmenuWithKeyboard();
                        }
                        break;
                }
            }
        }
		protected override void OnAccessKey (AccessKeyEventArgs e)
		{
			base.OnAccessKey (e);
			HandleUIAction ();
		}
Esempio n. 6
0
		protected override void OnAccessKey (AccessKeyEventArgs e)
		{
			//WDTDH
			base.OnAccessKey (e);
		}
 /// <summary>
 ///     The access key for this element was invoked. Base implementation sets focus to the element.
 /// </summary>
 /// <param name="e">The arguments to the access key event</param>
 protected virtual void OnAccessKey(AccessKeyEventArgs e)
 {
     this.Focus();
 }
Esempio n. 8
0
		protected override void OnAccessKey (AccessKeyEventArgs e)
		{
			base.OnAccessKey (e);
			OnClick ();
		}
Esempio n. 9
0
        protected override void OnAccessKey(AccessKeyEventArgs e)
        {
            if (TextBox != null)
                TextBox.Focus();

            base.OnAccessKey(e);
        }
Esempio n. 10
0
		protected virtual void OnAccessKey (AccessKeyEventArgs e)
		{
			throw new NotImplementedException ();
		}
Esempio n. 11
0
 /// <summary>
 /// Provides class handling for when an access key that is meaningful for this element is
 /// invoked.
 /// </summary>
 /// <param name="e">
 /// The event data to the access key event. The event data reports which key was invoked,
 /// and indicate whether the <see cref="AccessKeyManager"/> object that controls the sending
 /// of these events also sent this access key invocation to other elements.
 /// </param>
 protected override void OnAccessKey(AccessKeyEventArgs e)
 {
     Activate();
 }
Esempio n. 12
0
        /// <summary>
        /// アクセラレータキーが押されたときに呼ばれます。
        /// </summary>
        protected override void OnAccessKey(AccessKeyEventArgs e)
        {
            base.OnAccessKey(e);

            if (this.textBox != null)
            {
                this.textBox.Focus();
            }
        }
Esempio n. 13
0
		protected override void OnAccessKey (AccessKeyEventArgs e)
		{
			throw new NotImplementedException ();
		}
Esempio n. 14
0
        /// <internalOnly>
        ///     Forward the access key to our hosted ActiveX control
        ///</internalOnly> 
        protected override void OnAccessKey(AccessKeyEventArgs args)
        { 
            Debug.Assert(args.Key.Length > 0, "got an empty access key"); 
            //
 
        }
Esempio n. 15
0
        /// <summary>
        /// The Access key for this control was invoked.
        /// </summary>
        protected override void OnAccessKey(AccessKeyEventArgs e)
        {
            IsAccessKeyOrAutomation = true;

            base.OnAccessKey(e);
        }
Esempio n. 16
0
        private ProcessKeyResult ProcessKey(List<IInputElement> targets, string key, bool existsElsewhere, bool userInitiated)
        {
            if (targets != null)
            {
                bool oneUIElement = true;
                UIElement invokeUIElement = null;
                bool lastWasAccessed = false;

                int chosenIndex = 0;
                for (int i = 0; i < targets.Count; i++)
                {
                    UIElement target = targets[i] as UIElement;
                    Debug.Assert(target != null, "Targets should only be UIElements");
                    if (!target.IsEnabled)
                        continue;

                    if (invokeUIElement == null)
                    {
                        invokeUIElement = target;
                        chosenIndex = i;
                    }
                    else
                    {
                        if (lastWasAccessed)
                        {
                            invokeUIElement = target;
                            chosenIndex = i;
                        }

                        oneUIElement = false;
                    }

                    // 
                    lastWasAccessed = target.HasEffectiveKeyboardFocus;
                }

                if (invokeUIElement != null)
                {
                    AccessKeyEventArgs args = new AccessKeyEventArgs(key, !oneUIElement || existsElsewhere /* == isMultiple */,userInitiated);
                    try
                    {
                        invokeUIElement.InvokeAccessKey(args);
                    }
                    finally
                    {
                        args.ClearUserInitiated();
                    }

                    return (chosenIndex == targets.Count - 1) ? ProcessKeyResult.LastMatch : ProcessKeyResult.MoreMatches;
                }
            }

            return ProcessKeyResult.NoMatch;
        }
Esempio n. 17
0
 /// <summary>
 /// The Access key for this control was invoked.
 /// </summary>
 protected override void OnAccessKey(AccessKeyEventArgs e)
 {
     if (e.IsMultiple)
     {
         base.OnAccessKey(e);
     }
     else
     {
         // Don't call the base b/c we don't want to take focus
         OnClick();
     }
 }
Esempio n. 18
0
 /// <summary>
 /// The Access key for this control was invoked.
 /// </summary>
 protected override void OnAccessKey(AccessKeyEventArgs e)
 {
     MoveFocus(new TraversalRequest(FocusNavigationDirection.First));
 }
Esempio n. 19
0
 // Internal accessor for AccessKeyManager class
 internal void InvokeAccessKey(AccessKeyEventArgs e)
 {
     OnAccessKey(e);
 }
Esempio n. 20
0
 protected override void OnAccessKey(AccessKeyEventArgs e)
 {
     if (e != null)
     {
         if (string.Equals(e.Key, RenameShortcutKey.RenameOverloads, StringComparison.OrdinalIgnoreCase))
         {
             this.OverloadsCheckbox.IsChecked = !this.OverloadsCheckbox.IsChecked;
         }
         else if (string.Equals(e.Key, RenameShortcutKey.SearchInComments, StringComparison.OrdinalIgnoreCase))
         {
             this.CommentsCheckbox.IsChecked = !this.CommentsCheckbox.IsChecked;
         }
         else if (string.Equals(e.Key, RenameShortcutKey.SearchInStrings, StringComparison.OrdinalIgnoreCase))
         {
             this.StringsCheckbox.IsChecked = !this.StringsCheckbox.IsChecked;
         }
         else if (string.Equals(e.Key, RenameShortcutKey.PreviewChanges, StringComparison.OrdinalIgnoreCase))
         {
             this.PreviewChangesCheckbox.IsChecked = !this.PreviewChangesCheckbox.IsChecked;
         }
         else if (string.Equals(e.Key, RenameShortcutKey.Apply, StringComparison.OrdinalIgnoreCase))
         {
             this.Commit();
         }
     }
 }
Esempio n. 21
0
 /// <summary>
 /// The Access key for this control was invoked.
 /// </summary>
 protected override void OnAccessKey(AccessKeyEventArgs e)
 {
     SetFocus();
 }
 protected virtual void OnAccessKey(AccessKeyEventArgs e);
Esempio n. 23
0
        /// <summary>
        /// The Access key for this control was invoked.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnAccessKey(AccessKeyEventArgs e)
        {
            if (!IsKeyboardFocused)
            {
                Focus();
            }

            base.OnAccessKey(e);
        }
        protected override void OnAccessKey(AccessKeyEventArgs e)
        {
            Console.WriteLine(@"Window AccessKey '{0}'", e.Key);

            base.OnAccessKey(e);
        }