示例#1
0
 private void addButton_Click(object sender, EventArgs e)
 {
     if ((this.resultScreen.Contains('+')) || (this.resultScreen.Contains('-')) ||
         (this.resultScreen.Contains('x')) || (this.resultScreen.Contains('÷')))
     {
         this.equalButton_Click(sender, e);
     }
     if (this.resultLabel.Text.Length <= 14)
     {
         if (!this.resultScreen.Contains('+'))
         {
             this.oper = new Sum();
             this.result = float.Parse(this.resultScreen, CultureInfo.InvariantCulture.NumberFormat);
             this.oper.setResult(this.result);
             this.resultScreen = this.resultScreen + "+";
             this.resultLabel.Text = this.resultScreen;
         }
     }
 }
示例#2
0
 public void setOper(Operations oper)
 {
     this.oper = oper;
 }
示例#3
0
 public Percentage(Operations operation)
 {
     //Constructor method
     this.operation = operation;
 }