Esempio n. 1
0
        private void Enter_Clicked(object sender, EventArgs e)
        {
            if (PinBox.Text == null || PinBox.Text.Length < 1)
            {
                return;
            }

            OKClicked?.Invoke(this, e);
        }
 private void OnOKClicked()
 {
     OKClicked?.Invoke(this, new EventArgs());
 }
 protected virtual void OnOKClicked(Result result)
 {
     OKClicked?.Invoke(this, result);
 }
Esempio n. 4
0
        private void Item_Click(object sender, EventArgs e)
        {
            Button btn     = (Button)sender;
            string display = this.txtDisplay.Text;

            double idisplay;

            double.TryParse(display, out idisplay);

            switch (btn.Tag.ToString())
            {
            case "1":
            case "2":
            case "3":
            case "4":
            case "5":
            case "6":
            case "7":
            case "8":
            case "9":
            case "0":
                display += btn.Tag.ToString();
                break;

            case ".":
                if (!display.Contains("."))
                {
                    display += ".";
                }
                break;

            case "+1":
                idisplay += 1;
                display   = idisplay.ToString();
                break;

            case "+10":
                idisplay += 10;
                display   = idisplay.ToString();
                break;

            case "+100":
                idisplay += 100;
                display   = idisplay.ToString();
                break;

            case "-1":
                idisplay -= 1;
                display   = idisplay.ToString();
                break;

            case "-10":
                idisplay -= 10;
                display   = idisplay.ToString();
                break;

            case "-100":
                idisplay -= 100;
                display   = idisplay.ToString();
                break;

            case "+/-":
                idisplay = idisplay * -1;
                display  = idisplay.ToString();
                break;

            case "Back":
                if (display.Length > 0)
                {
                    display = display.Substring(0, display.Length - 1);
                }
                break;

            case "C":
                display = "";
                break;

            case "OK":
                OKClicked?.Invoke(display, null);
                break;

            case "Cancel":
                CancleClicked?.Invoke(display, null);
                break;

            default:
                break;
            }

            this.txtDisplay.Text = display;
        }
Esempio n. 5
0
 /// <summary>
 /// Helper functions to let renderers to fire the OKClicked event
 /// </summary>
 public void FireOKEvent()
 {
     OKClicked?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 6
0
 private void BtnOK_LeftClick(object sender, EventArgs e)
 {
     Hide();
     OKClicked?.Invoke(this, EventArgs.Empty);
 }