public Calculator() { InitializeComponent(); equal = 0; tmp = 0; action = PrevAction.Add; clear = false; }
public void RepopulateLinks() { if (this.PrevAction != null) { PrevAction.NextAction = this; PrevAction.RepopulateLinks(); } }
private void Esc() { equal = 0; tmp = 0; action = PrevAction.Add; clear = false; textBoxEqual.Text = "0"; textBoxActivity.Text = ""; }
private void Equal() { if (action != PrevAction.Equal && action != PrevAction.none) { Action(); action = PrevAction.Equal; textBoxActivity.Text = Convert.ToString(equal); textBoxEqual.Text = Convert.ToString(equal); tmp = Convert.ToDouble(textBoxEqual.Text); } }
private void Division() { if (action == PrevAction.Equal) { textBoxActivity.Text += " / "; } else if (textBoxEqual.Text.Length != 0 && !clear) { textBoxActivity.Text += (textBoxEqual.Text + " / "); textBoxEqual.Clear(); } else { textBoxActivity.Text = textBoxActivity.Text.Remove(textBoxActivity.Text.Length - 3) + " / "; } Action(); action = PrevAction.Division; clear = true; tmp = 0; textBoxEqual.Text = Convert.ToString(equal); }