Beispiel #1
0
 private void Modulus_Click(object sender, EventArgs e)
 {
     operation = "modulus";
     if (equalsClicked)
     {
         equalsClicked = false;
     }
     if (TextField.TextLength == 0)
     {
         num1 = "0";
     }
     else if (num1 == "")
     {
         num1 = TextField.Text;
         TextField.Clear();
     }
     else
     {
         num2 = TextField.Text;
         TextField.Clear();
         number1        = Convert.ToDouble(num1);
         number2        = Convert.ToDouble(num2);
         num1           = Convert.ToString(number1 % number2);
         TextField.Text = num1;
         num1           = "";
         operation      = "";
     }
 }
Beispiel #2
0
        private void Clear_Click(object sender, EventArgs e)
        {
            TextField.Clear();
            num1 = "";

            num2 = "";

            number1 = 0.0;
            number2 = 0.0;

            operation = "";
        }
Beispiel #3
0
 private void TxtAddressOption_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (_ddlAddressOption == null)
     {
         EnsureChildControls();
     }
     if (_ddlAddressOption.SelectedValue.Equals("03"))
     {
         _txtOtherSpecify.Enabled = true;
     }
     else
     {
         _txtOtherSpecify.Enabled = false; _txtOtherSpecify.Clear();
     }
 }
Beispiel #4
0
        private void Five_Click(object sender, EventArgs e)
        {
            if (equalsClicked)
            {
                TextField.Clear();
                num1 = "";

                num2 = "";

                number1 = 0.0;
                number2 = 0.0;

                operation = "";
            }
            TextField.AppendText("5");
        }
Beispiel #5
0
 public void Execute(bool clear)
 {
     if (Target.Bind(DAL, IE))
     {
         TextField sl = new TextField(Target.WatinElement.DomContainer, Target.WatinElement.NativeElement);
         if (clear)
         {
             sl.Clear();
         }
         sl.TypeText(text);
     }
     else
     {
         //write error log
     }
 }
Beispiel #6
0
 private void TextReceived(object sender, string text)
 {
     GameConsole.SendText(text);
     input.Clear();
 }
Beispiel #7
0
        private void Button_Click(object sender, EventArgs e)
        {
            var button = sender as Button;

            if (double.TryParse(button.Text, out double _))
            {
                if (_activeOperation)
                {
                    TextField.Clear();
                    _activeOperation = !_activeOperation;
                }
                if (TextField.Text == "0" || TextField.Text == "∞" || TextField.Text == "-∞")
                {
                    TextField.Text = button.Text;
                }
                else
                {
                    TextField.Text += button.Text;
                }
                return;
            }

            switch (button.Text)
            {
            case "+":
                _activeOperation = true;
                UpdateNumberIfNotEmpty(TextField,
                                       _operator.GetResult(new PlusOperation(), double.Parse(TextField.Text)).ToString());
                break;

            case "-":
                _activeOperation = true;
                UpdateNumberIfNotEmpty(TextField,
                                       _operator.GetResult(new MinusOperation(), double.Parse(TextField.Text)).ToString());
                break;

            case "*":
                _activeOperation = true;
                UpdateNumberIfNotEmpty(TextField,
                                       _operator.GetResult(new MultiplyOperation(), double.Parse(TextField.Text)).ToString());
                break;

            case "/":
                _activeOperation = true;
                UpdateNumberIfNotEmpty(TextField,
                                       _operator.GetResult(new DivideOperation(), double.Parse(TextField.Text)).ToString());
                break;

            case "=":
                UpdateNumberIfNotEmpty(TextField,
                                       _operator.GetResult(null, double.Parse(TextField.Text)).ToString());
                break;

            case ",":
            {
                if (_activeOperation || TextField.Text.Contains(","))
                {
                    return;
                }

                TextField.Text += ',';
                break;
            }

            default:
                MessageBox.Show(@"Error!");
                break;
            }
        }
Beispiel #8
0
 private void ClearButton_Click(object sender, EventArgs e)
 {
     TextField.Clear();
     _operator.Reset();
 }
Beispiel #9
0
 /// <summary>
 /// 清空文本框
 /// </summary>
 /// <param name="text"></param>
 public void ClearText(TextField text)
 {
     text.Clear();
 }
Beispiel #10
0
 private void EnableChange(object sender, RoutedEventArgs e)
 {
     TextBoxEnable = (bool)EnableCheckBox.IsChecked;
     TextField.Clear();
 }
Beispiel #11
0
 // Use this for initialization
 void Start()
 {
     nameTextfield.Clear();
     Destroy(this.gameObject);
 }