/// <summary> /// Gets an array containing all selected items. /// </summary> internal static AutomationElement[] SelectedItemsBridge(this SelectionAdapter extension, BaseProdControl control) { //try //{ // /* Try UIA First */ // UiaInvoke(control); //} //catch (ArgumentNullException err) //{ // throw new ProdOperationException(err); //} //catch (ElementNotAvailableException err) //{ // throw new ProdOperationException(err); //} //catch (InvalidOperationException) //{ // /* now try a native SendMessage */ // NativeInvoke(control); //} return(null); }
/// <summary> /// Raises the DropDownKeyDown event when a key down event occurs /// when the drop down is open. /// </summary> /// <param name="e">The event data.</param> protected void OnDropDownKeyDown(KeyEventArgs e) { if (e == null || e.Handled) { return; } if (SelectionAdapter != null) { SelectionAdapter.HandleKeyDown(e); if (e.Handled) { return; } } switch (e.Key) { case Key.Enter: OnAdapterSelectionComplete(this, new RoutedEventArgs()); e.Handled = true; break; case Key.Escape: OnAdapterSelectionCanceled(this, new RoutedEventArgs()); e.Handled = true; break; case Key.F4: ToggleDropDown(this, e); e.Handled = true; break; default: break; } }