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; }
/// <summary>a new instance of the BasicMathClient class.</summary> /// <param name="mathPerformer"></param> public BasicMathClient(IBasicMath mathPerformer) { _mathPerformer = mathPerformer; }
public CalculatorBuilder(IBasicMath math) { this.math = math; this._calculatorNodes = new List <ICalulatorNode>(); }
// Extend IBasicMath this method and this // implementation. public static int Subtract(this IBasicMath itf, int x, int y) { return(x - y); }