public CalculatorController(ICalculatorView view) { this.view = view; this.view.NumberPressed += HandleNumberPressed; this.view.OperatorPressed += HandleOperatorPressed; this.view.ModifierPressed += HandleModifierPressed; }
public CalculatorPresenter(ICalculatorView view, ICalculatorRepository repo, IHttpRepository httpRepo, ILogger logger, string ServiceUrl, bool IsDev) { _view = view; _calRepo = repo; _view.SubmitClick += SubmitClick; _httpRepo = httpRepo; _logger = logger; _serviceUrl = ServiceUrl; _isDev = IsDev; }
public CalculatorPresenter(ICalculatorView calculatorView, IMessageBoxDisplayService messageBoxDisplayService, ISaveHistoryService saveHistoryService, ICalculatorEngine businessLogicObject) { _calculatorView = calculatorView; _messageBoxDisplayService = messageBoxDisplayService; _saveHistoryService = saveHistoryService; _calculatorEngine = businessLogicObject; calculatorView.DigitClicked += OnDigitClick; calculatorView.OperatorClicked += OnOperatorClick; calculatorView.ResultClicked += OnResultClick; calculatorView.SaveHistoryClicked += OnSaveHistoryClick; calculatorView.MemoryClicked += OnMemoryClick; calculatorView.ClearAllClicked += OnClearAllClick; calculatorView.ClearEntryClicked += OnClearEntryClick; calculatorView.EraseHistoryClicked += OnEraseHistory; }
/// <summary> /// Create a new calculator controller /// </summary> /// <param name="model">The model to use with the controller</param> /// <param name="view">The view to use with the controller</param> public CalculatorController(ICalculatorModel model, ICalculatorView view) { Model = model; View = view; //listen View key pressed View.OnKeyPressed += HandleKeyPressed; //listen Model operands & operation Model.OnOperandChanged += HandleOperandChanged; Model.OnOperationChanged += HandleOperationChanged; Model.OnResultComputed += HandleResultComputed; Model.OnCleared += HandleModelCleared; //Clear model at beginning Model.Clear(); }
public CalculatorPresenter( ICalculatorView calculatorView, IEquationEvaluator equationParser ) { this.calculatorView = calculatorView; this.equationParser = equationParser; this.calculatorView.NumberPressed += this.OnNumberPressed; this.calculatorView.DecimalPressed += this.OnDecimalPointPressed; this.calculatorView.MulitplyPressed += this.OnMulitplyPressed; this.calculatorView.DividePressed += this.OnDividePressed; this.calculatorView.AddPressed += this.OnAddPressed; this.calculatorView.SubtractPressed += this.OnSubtractPressed; this.calculatorView.EqualsPressed += this.OnEqualsPressed; this.calculatorView.ClearPressed += this.OnClearPressed; this.calculatorView.OpenBracketPressed += this.OnOpenBracketPressed; this.calculatorView.CloseBracketPressed += this.OnCloseBracketPressed; }
public CalculatorPresenter(ICalculatorView view) { this.view = view; }
public FileCalculator(ICalculatorView view) { _view = view; }
public ConsoleCalculator(ICalculatorView view) { _view = view; }
public Presenter(ICalculatorView view) { this._View = view; }
public StringCalculator(ICalculatorView view) { View = view; }