protected void OnButtonOperationClicked(object sender, EventArgs e) { if (screen.Text == "") { return; } var button = (Button)sender; if (screen.Text[screen.Text.Length - 1] == ' ') { screen.Text = screen.Text.Remove(screen.Text.Length - 3); } screen.Text = CalculateMachine.Calculate(screen.Text); screen.Text = screen.Text + " " + button.Label + " "; }
protected void OnButtonResultClicked(object sender, EventArgs e) { screen.Text = CalculateMachine.Calculate(screen.Text); }