Пример #1
0
        private void OnConfirmBtnClick(EventContext context)
        {
            ClickHandler clickHandler = this._clickHandler;

            this.Hide();
            clickHandler?.Invoke(0);
        }
Пример #2
0
 private async void OnButtonClick(object sender, EventArgs e)
 {
     if (ClickHandler != null)
     {
         await ClickHandler.Invoke(Value as T);
     }
 }
Пример #3
0
        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);
            }
        }
Пример #6
0
 private void Clicked()
 {
     if (confirm_.Value)
     {
         confirm_.Value  = false;
         button_.Enabled = false;
         handler_?.Invoke();
     }
 }
Пример #7
0
        private void OnCancelBtnClick(EventContext context)
        {
            ClickHandler clickHandler = this._clickHandler;

            this.Hide();
            if (clickHandler != null)
            {
                clickHandler.Invoke(1);
            }
        }
Пример #8
0
 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);
 }
Пример #9
0
            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);
            }
Пример #10
0
 protected override void OnMouseDown(MouseButtonEventArgs e)
 {
     if (e.ChangedButton == MouseButton.Left && !e.Handled && LinkIsClickable())
     {
         if (_clicked != null)
         {
             _clicked.Invoke(this);
             e.Handled = true;
         }
     }
 }
Пример #11
0
 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);
 }
Пример #12
0
 public override void OnClick()
 {
     //TODO
     if (this.Enable)
     {
         if (ClickHandler != null)
         {
             index = 2;
             this.controlStatus = ControlStatus.Release;
             ClickHandler.Invoke();
         }
     }
 }
Пример #13
0
 // 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();
         }
     }
 }
Пример #14
0
        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);
        }
Пример #15
0
    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);
            }
        }
    }
Пример #16
0
    // 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;
        }
    }
Пример #17
0
 private void OnClick(object sender, EventArgs e)
 {
     ClickHandler?.Invoke(this, EventArgs.Empty);
 }
Пример #18
0
 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);
 }
Пример #20
0
 public void OnPointerClick(PointerEventData eventData)
 {
     ClickHandler?.Invoke(this.LogicalCard);
 }
Пример #21
0
 private void clickExecute()
 {
     ClickHandler?.Invoke(this);
 }
Пример #22
0
 public static void NotifyClickHandler()
 {
     ClickHandler?.Invoke();
 }