Inheritance: DefaultMenuAction, MenuAction
Example #1
0
 public Calculator()
 {
     InitializeComponent();
     equal  = 0;
     tmp    = 0;
     action = PrevAction.Add;
     clear  = false;
 }
Example #2
0
 public void RepopulateLinks()
 {
     if (this.PrevAction != null)
     {
         PrevAction.NextAction = this;
         PrevAction.RepopulateLinks();
     }
 }
Example #3
0
 private void Esc()
 {
     equal                = 0;
     tmp                  = 0;
     action               = PrevAction.Add;
     clear                = false;
     textBoxEqual.Text    = "0";
     textBoxActivity.Text = "";
 }
Example #4
0
 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);
     }
 }
Example #5
0
 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);
 }