public static WidgetEventArgs ButtonUp(MenuInputButton button) { var result = new WidgetEventArgs(); result.InitializeButtonUp(button); return(result); }
public void WhenIPressAButton(MenuInputButton input, int times) { for (int i = 0; i < times; i++) { WhenIPressAButton(input); } }
public void SendButtonPress(MenuInputButton btn) { context.Desktop.ButtonDown(btn); context.Desktop.ButtonUp(btn); context.WaitForAnimations(); }
private void NavigateListLayout(string menuItem, MenuInputButton nextButton, MenuInputButton prevButton) { var menu = context.Desktop.ActiveWorkspace.ActiveWindow as Menu; ListLayout layout = menu.Layout as ListLayout; var target = layout.Items.SingleOrDefault(w => w.Name.Equals(menuItem, StringComparison.OrdinalIgnoreCase)); if (target == null) { throw new InvalidOperationException($"Could not find {menuItem} in {menu.Name}. Active workspace: {context.Desktop.ActiveWorkspace}"); } var targetIndex = layout.IndexOf(target); while (targetIndex > layout.FocusIndex) { Desktop.ClearAnimations(); instructor.SendButtonPress(nextButton); } while (targetIndex < layout.FocusIndex) { instructor.SendButtonPress(prevButton); } }
protected override void OnButtonDown(MenuInputButton button) { switch (button) { case MenuInputButton.Cancel: cancelButton = true; break; } base.OnButtonDown(button); }
protected override void OnButtonUp(MenuInputButton button) { switch (button) { case MenuInputButton.Cancel: if (cancelButton) { cancelEventArgs.Cancel = false; OnCancel(cancelEventArgs); if (!cancelEventArgs.Cancel) { OnExit(); } cancelButton = false; } break; } }
public void WhenIPressAButton(MenuInputButton input) { instructor.SendButtonPress(input); }
void IWidgetEventArgsInitialize.InitializeButtonUp(MenuInputButton button) { InitializeButtonUp(button); }
private void InitializeButtonUp(MenuInputButton button) { EventType = WidgetEventType.ButtonUp; Button = button; Handled = false; }
public bool this[MenuInputButton button] { get => pressedInputButtons.Contains(button);
protected void Send(MenuInputButton button) { ListLayout.InputEvent(WidgetEventArgs.ButtonDown(button)); ListLayout.InputEvent(WidgetEventArgs.ButtonUp(button)); }