コード例 #1
0
ファイル: Multiply.cs プロジェクト: viviperrr/DesignPatterns
 public int Calculate(ICalcType ctype, int a, int b)
 {
     if (ctype == ICalcType.Multiply)
     {
         return(a * b);
     }
     else
     {
         return(this._next.Calculate(ctype, a, b));
     }
 }
コード例 #2
0
 public int Calculate(ICalcType ctype, int a, int b)
 {
     if (ctype == ICalcType.Divide)
     {
         return(a / b);
     }
     else
     {
         return(this._next.Calculate(ctype, a, b));
     }
 }
コード例 #3
0
ファイル: Substract.cs プロジェクト: viviperrr/DesignPatterns
 public int Calculate(ICalcType ctype, int a, int b)
 {
     if (ctype == ICalcType.Substract)
     {
         return(a - b);
     }
     else
     {
         return(this._next.Calculate(ctype, a, b));
     }
 }