示例#1
0
 public int CalculateMetrics(Arithemetic objArithemetic)
 {
     switch (objArithemetic.OpertionType)
     {
         case Arithemetic.Options.Add:
         {
             return Add(objArithemetic);
         }
         case Arithemetic.Options.Sub:
         {
             return Sub(objArithemetic);
         }
         case Arithemetic.Options.Mul:
         {
             return Mul(objArithemetic);
         }
         default:
             return 0;
     }
 }
示例#2
0
 private int Sub(Arithemetic objArithemetic)
 {
     return objArithemetic.Operand1 - objArithemetic.Operand2;
 }
示例#3
0
 private int Mul(Arithemetic objArithemetic)
 {
     return objArithemetic.Operand1*objArithemetic.Operand2;
 }
示例#4
0
 private int Add(Arithemetic objArithemetic)
 {
     return objArithemetic.Operand1 + objArithemetic.Operand2;
 }