Exemple #1
0
        public override decimal Calc()
        {
            decimal R = RightSide.Calc();
            decimal L = LeftSide.Calc();

            if (OperatorsType.Addition == ThisOperatorsType)
            {
                return(L + R);
            }
            else if (OperatorsType.Division == ThisOperatorsType)
            {
                return(L / R);
            }
            else if (OperatorsType.Subtraction == ThisOperatorsType)
            {
                return(L - R);
            }
            else if (OperatorsType.Multiplication == ThisOperatorsType)
            {
                return(L * R);
            }
            else
            {
                MessageBox.Show("エラー");
                return(0);
            }
        }