public CalculatorPresenter(View.ICalculatorView view) { mView = view; mView.ButtonClick += BtnClick; mCalculate = new Model.Calculator(); }
public CalculatorViewModel() { this._calc = new Calculator(); this.display = "0"; this.FirstOperand = string.Empty; this.SecondOperand = string.Empty; this.Operation = string.Empty; }
public MainWindowViewModel() { _selectedFont = "Arial"; _selectedColor = "White"; _calc = new Model.Calculator(); ButtonCommand = new RelayCommand( new Action <object>(delegate(object arg) { ProcessInput(arg as string); OnPropertyChanged("Display"); OnPropertyChanged("ButtonsDisabled"); })); logger.LogInfoMessage("Created with Font: " + _selectedColor + " and Color: " + _selectedColor); }
private static UnityContainer Init(string fileName) { var container = new UnityContainer(); var directoryName = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); container.RegisterInstance(FILE_PATH, Path.Combine(directoryName, fileName)); var calculator = new Model.Calculator(); container.RegisterInstance<ICalculator>(calculator); container.RegisterType(typeof(ICommand), typeof(AddCommand), ADD); container.RegisterType(typeof(ICommand), typeof(MultiplyCommand), MULTIPLY); container.RegisterType(typeof(ICommand), typeof(ApplyCommand), APPLY); return container; }
private static UnityContainer Init(string fileName) { var container = new UnityContainer(); var directoryName = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); container.RegisterInstance(FILE_PATH, Path.Combine(directoryName, fileName)); var calculator = new Model.Calculator(); container.RegisterInstance <ICalculator>(calculator); container.RegisterType(typeof(ICommand), typeof(AddCommand), ADD); container.RegisterType(typeof(ICommand), typeof(MultiplyCommand), MULTIPLY); container.RegisterType(typeof(ICommand), typeof(ApplyCommand), APPLY); return(container); }
public CalculatorViewModel() { calculateParams = new Model.Calculator { InitialPrincipal = 0.0, AnnualRate = 0.0, CalculationDate = DateTime.Now, AgreementDate = DateTime.Now, InvestmentDuration = 0 }; }
public void SetUp() { calculator = new Model.Calculator(); }
public void Constructor_NullCalculator_ThrowsException() { Model.Calculator calculator = null; _command = new ApplyCommand(calculator, _numberToApply); }