コード例 #1
0
ファイル: Form1.cs プロジェクト: Yaroslav08/Homeworks
        private void Equal()
        {
            this.operand       *= (double)this.sign;
            this.sign           = 1;
            this.operand_       = this.operand;
            this.was_operation_ = this.was_operation;
            switch (this.was_operation)
            {
            case Form1.Action.Addition:
                this.operand = this.old_operand + this.operand;
                break;

            case Form1.Action.Subtraction:
                this.operand = this.old_operand - this.operand;
                break;

            case Form1.Action.Multiplication:
                this.operand = this.old_operand * this.operand;
                break;

            case Form1.Action.Division:
                this.operand = this.old_operand / this.operand;
                break;
            }
            this.old_operand = this.operand;
            this.Opetand_to_indicator();
            this.fractional = false;
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Yaroslav08/Homeworks
 private void ClearAll()
 {
     this.was_equal     = false;
     this.operand       = 0.0;
     this.was_operation = Form1.Action.Empty;
     this.old_operand   = 0.0;
     this.fractional    = false;
     this.sign          = 1;
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: Yaroslav08/Homeworks
 private void button14_Click(object sender, EventArgs e)
 {
     if (this.was_equal)
     {
         this.old_operand   = this.operand;
         this.operand       = this.operand_;
         this.was_operation = this.was_operation_;
     }
     this.was_equal = true;
     this.Equal();
     this.was_operation = Form1.Action.Empty;
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: Yaroslav08/Homeworks
 private void operation(Form1.Action oper)
 {
     if (this.block_double_operation)
     {
         return;
     }
     this.block_double_operation = true;
     this.Equal();
     this.was_equal     = false;
     this.was_operation = oper;
     this.old_operand   = this.operand;
     this.fractional    = false;
     this.operand       = 0.0;
 }