Beispiel #1
0
 public CashierController(ICashierView view, List <item> items)
 {
     View  = view;
     Items = items;
     view.SetController(this);
     Cashier = Cashier.GetInstance();
 }
        public CashierPresenter(ICashierView cashierView, ICurrencyService currencyService, ITransactionService transactionService)
        {
            CashierView        = cashierView;
            CurrencyService    = currencyService;
            TransactionService = transactionService;

            CashierView.GetCurrenciesEvent        += SetCurrencies;
            CashierView.InitTransactionEvent      += PerformTransaction;
            CurrencyService.UpdateCurrenciesEvent += SetCurrencies;
        }
Beispiel #3
0
        public CashierPresenter(ICashierView cashierView, ICurrencyService currencyService,
                                IOperationService operationService)
        {
            _cashierView      = cashierView;
            _currencyService  = currencyService;
            _operationService = operationService;

            _cashierView.GetCurrencies        += GetCurrencies;
            _cashierView.PerformOperation     += PerformOperation;
            _currencyService.UpdateCurrencies += GetCurrencies;
        }
        public CashierPresenter(ICashierView view, IUnityContainer container)
        {
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }
            this.SubmitCommand = new DelegateCommand <object>(this.Submit, this.CanSubmit);
            this.CancelCommand = new DelegateCommand <object>(this.Cancel);

            this._view = view;
            this._view.SetPresenter(this);
            this._container = container;

            IOrderFactory orderFactory = this._container.Resolve <IOrderFactory>();

            this._orderViewModel = new OrderViewModel(container, orderFactory.CreateOrder(OrderType.SalesOrder));
            this._container.RegisterInstance <IOrderViewModel>(this._orderViewModel, new ExternallyControlledLifetimeManager());
        }