private void buttonMod_Click(object sender, EventArgs e) { Evalueted = false; if (AllOperations.Contains(expression.Text.Last())) { expression.Text = $"{expression.Text.Remove(expression.Text.Length - 1, 1)}%"; } else { expression.Text += "%"; } }
private void buttonPI_Click(object sender, EventArgs e) { string[] lexems = expression.Text.Split(SplitersOperation); if (expression.Text == "0" || lexems.Last().Contains(".") || !AllOperations.Contains(expression.Text.Last())) { expression.Text = Math.Round(Math.PI, 10).ToString().Replace(",", "."); Evalueted = false; } else { expression.Text += Math.PI.ToString().Replace(",", "."); } }
private void Memory_MouseDown(object sender, MouseEventArgs e) { switch (e.Button) { case MouseButtons.Left: Memory.Text = "0"; break; case MouseButtons.Middle: Clipboard.SetText(Memory.Text); break; case MouseButtons.Right: expression.Text = !AllOperations.Contains(expression.Text.Last()) ? Memory.Text : (expression.Text + Memory.Text); break; } }