예제 #1
0
        public MainWindowViewModel(IBasicMath mathLib, IComplexMath complexMathLib)
        {
            //mathLib = new BasicMath();
            //complexMathLib = new ComplexMath();
            if (mathLib is null)
            {
                throw new NullReferenceException("The mathLib instance was null, please inject your implementation!");
            }

            if (complexMathLib is null)
            {
                throw new NullReferenceException("The complexMathLib instance was null, please inject your implementation!");
            }
            Calculate           = new DelegateCommand <string>(calculateResult);
            CalculateExpression = new DelegateCommand(calculateExpressionResult);
            _mathLib            = mathLib;
            _complexMathLib     = complexMathLib;
        }
예제 #2
0
 /// <summary>a new instance of the BasicMathClient class.</summary>
 /// <param name="mathPerformer"></param>
 public BasicMathClient(IBasicMath mathPerformer)
 {
     _mathPerformer = mathPerformer;
 }
예제 #3
0
 public CalculatorBuilder(IBasicMath math)
 {
     this.math             = math;
     this._calculatorNodes = new List <ICalulatorNode>();
 }
예제 #4
0
파일: Program.cs 프로젝트: linuxemb/C_sharp
 // Extend IBasicMath this method and this
 // implementation.
 public static int Subtract(this IBasicMath itf,
                            int x, int y)
 {
     return(x - y);
 }
예제 #5
0
 /// <summary>a new instance of the BasicMathClient class.</summary>
 /// <param name="mathPerformer"></param>
 public BasicMathClient(IBasicMath mathPerformer)
 {
     _mathPerformer = mathPerformer;
 }