private void OnConfirmBtnClick(EventContext context) { ClickHandler clickHandler = this._clickHandler; this.Hide(); clickHandler?.Invoke(0); }
private async void OnButtonClick(object sender, EventArgs e) { if (ClickHandler != null) { await ClickHandler.Invoke(Value as T); } }
private void OnCancelBtnClick(EventContext context) { ClickHandler clickHandler = this._clickHandler; this.Hide(); clickHandler?.Invoke(1); }
public void OnClick() { ClickHandler tmp = Click; if (tmp != null) { tmp.Invoke(this, EventArgs.Empty); } }
public void OnClick() { ClickHandler clickHandler = Click; if (clickHandler != null) { clickHandler.Invoke(this, EventArgs.Empty); } }
private void Clicked() { if (confirm_.Value) { confirm_.Value = false; button_.Enabled = false; handler_?.Invoke(); } }
private void OnCancelBtnClick(EventContext context) { ClickHandler clickHandler = this._clickHandler; this.Hide(); if (clickHandler != null) { clickHandler.Invoke(1); } }
public ButtonTableCell(Control button) : base(button) { InitializeComponent(); _button = button ?? throw new ArgumentNullException(nameof(button)); button.Click += ((sender, evt) => ClickHandler?.Invoke(Value as T)); SuspendLayout(); Controls.Add(button); LanguageManager.TranslateWinForm(GlobalOptions.Language, this); button.PerformLayout(); ResumeLayout(false); }
bool IMessageFilter.PreFilterMessage(ref Message m) { switch (m.Msg) { case 513: //鼠标左键Down if (click != null) { click.Invoke(); } break; case 516: //鼠标右键Down if (click != null) { click.Invoke(); } break; } return(false); }
protected override void OnMouseDown(MouseButtonEventArgs e) { if (e.ChangedButton == MouseButton.Left && !e.Handled && LinkIsClickable()) { if (_clicked != null) { _clicked.Invoke(this); e.Handled = true; } } }
public ButtonTableCell(Control button) : base(button) { InitializeComponent(); _button = button ?? throw new ArgumentNullException(nameof(button)); button.Click += ((sender, evt) => ClickHandler?.Invoke(Value as T)); SuspendLayout(); Controls.Add(button); this.UpdateLightDarkMode(); this.TranslateWinForm(); button.PerformLayout(); ResumeLayout(false); }
public override void OnClick() { //TODO if (this.Enable) { if (ClickHandler != null) { index = 2; this.controlStatus = ControlStatus.Release; ClickHandler.Invoke(); } } }
// Checks if given bool is different from active. If it is, it sets active to the given bool and calls the correct delegate, either Enable or Disable public void SetActive(bool newActive) { if (active != newActive) { active = newActive; if (newActive) { Enable?.Invoke(); } else { Disable?.Invoke(); } } }
internal virtual bool Update() { int height = (int)GUIHelper.StrSize(text).Y + 8; Rectangle option = new Rectangle(owner.position.X, owner.position.Y + yOff, height + width, height); if (option.IntersectsMouse() && Input.LeftR) { if (onClick != null) { onClick.Invoke(this, new EventArgs()); } return(true); } return(false); }
void RayCastOnClick() { int layerMask = 1 << 16; RaycastHit hit; Ray ray = cam.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask)) { previousHit = currentHit; currentHit = hit.collider; if (onClick != null) { onClick.Invoke(this); } } }
// Update is called once per frame void Update() { // On press if (Input.GetMouseButton(0)) { if (initialClick) { uiClick = MouseOverUI(); initialClick = false; initialPosition = Camera.main.transform.position; initialClick = false; hasDragged = false; if (uiClick) { return; } pressHandler?.Invoke(GetMousePosition()); /** * // Testing enemy response to noise * GameObject tempNoise = Instantiate(Globals.NOISE, transform.position, Quaternion.identity); * tempNoise.transform.position = GetMousePosition(); * tempNoise.GetComponent<Noise>().Initialize(true, 3.5f); * /**/ } if (Vector2.Distance(initialPosition, Camera.main.transform.position) >= minDragLength) { hasDragged = true; } } if (!Input.GetMouseButton(0)) { if (!initialClick && !hasDragged && !uiClick) { releaseHandler?.Invoke(GetMousePosition()); } initialClick = true; } }
private void OnClick(object sender, EventArgs e) { ClickHandler?.Invoke(this, EventArgs.Empty); }
public TrayService() : base() { serviceNative = new TrayServiceNative(); serviceNative.ClickHandler = () => ClickHandler?.Invoke(); }
/// <summary> /// Raise an event when the item-click takes place. /// </summary> /// <param name="position">Position.</param> void OnClick(int position) { ClickHandler?.Invoke(this, position); }
public void OnPointerClick(PointerEventData eventData) { ClickHandler?.Invoke(this.LogicalCard); }
private void clickExecute() { ClickHandler?.Invoke(this); }
public static void NotifyClickHandler() { ClickHandler?.Invoke(); }