public ProductsPresenter(ICatalogService catalog, IProductsView view)
 {
     _catalog = catalog;
     _view    = view;
     view.SetCategories(catalog.GetCategories());
     view.CategorySelected += (sender, args) => SelectCategory(args.Category);
 }
 public ProductsPresenter(ICatalogService catalog, IProductsView view)
 {
     _catalog = catalog;
     _view = view;
     view.SetCategories(catalog.GetCategories());
     view.CategorySelected += (sender, args) => SelectCategory(args.Category);
 }
 public ProductView(IProductsView ProductsProductView)
 {
     ProductsProducts = ProductsProductView;
     if (products.Count == 0)
     {
         InitialiseProducts();
     }
 }
Example #4
0
        /// <summary>
        /// Add a view to the observer list, and subscribe to its events.
        /// </summary>
        /// <param name="view"></param>
        public void addObserver(IProductsView view)
        {
            // subscribe to view events
            view.addProductRequest       += V_addProductRequest;
            view.populateProductsRequest += V_populateRequest;
            view.deleteProductRequest    += V_deleteProductRequest;

            // add the view to the list of observers.
            this.views.Add(view);
        }
Example #5
0
 public MainView(IGroupsView groupsView, IProductsView productsView, Control receiptView) : this()
 {
     this.groupsView   = groupsView;
     this.productsView = productsView;
     this.receiptView  = receiptView;
     (this.groupsView as Control).Dock   = DockStyle.Fill;
     (this.productsView as Control).Dock = DockStyle.Fill;
     this.receiptView.Dock = DockStyle.Fill;
     splitContainer.Panel1.Controls.Add(this.receiptView);
     ShowGroupsView();
 }
        public ProductsPresenter(IProductsView v)
        {
            cts = new CancellationTokenSource();
            svc = new ClientService(cts.Token);

            view = v;
            view.GenerateProducts += View_GenerateProducts;
            view.GetProducts      += View_GetProducts;
            view.GetProduct       += View_GetProduct;
            view.UpdateProduct    += View_UpdateProduct;
            view.Cancel           += View_Cancel;
        }
Example #7
0
 public ProductsPresenter(IProductsView view, IRestAPI api, ISettings settings)
 {
     this.view = view;
     this.api  = api;
     args      = new Dictionary <string, object>()
     {
         { "start", 0 },
         { "limit", settings.ItemsPerPage },
         { "filter_name", string.Empty }
     };
     WireUpEvents();
 }
 public OrderCommandHandlers(IRepository repository, IProductsView adminProductsView)
 {
     this.repository  = repository;
     this.productView = new ProductView(adminProductsView);
 }
Example #9
0
 public ProductsPresenter(IProductsView view, IProductDAO productDAO, IOpenFileWrapper openFileWrapper)
 {
     this.view            = view;
     this.productDao      = productDAO;
     this.openFileWrapper = openFileWrapper;
 }
Example #10
0
 public ProductsPresenter(ProductsView view)
 {
     this.view = view;
     SubsribeToEvents();
 }
Example #11
0
 public ProductsPresenter(IProductsView view, IAppDbContext dbContext) : base(dbContext)
 {
     _view = view;
 }
Example #12
0
 public ProductsPresenter(IProductsView view, IProductDAO productDAO, IOpenFileWrapper openFileWrapper)
 {
     this.view = view;
     this.productDao = productDAO;
     this.openFileWrapper = openFileWrapper;
 }
Example #13
0
 public Products()
 {
     ProductsProductView = new FakeProductsProductView();
     productView         = new ProductView(ProductsProductView);
 }