예제 #1
0
        public MainWindow(ICatalogManager catMgr, IFinancialManager finMgr)
        {
            InitializeComponent();

            _catMgr = catMgr;
            _finMgr = finMgr;

            var root = new TreeViewItem();
            root.Header = "Tree";

            var child = new TreeViewItem();
            child.Header = "Initial Data Typing";
            root.Items.Add(child);

            child = new TreeViewItem();
            child.Header = "Descriptions";
            root.Items.Add(child);

            MainTreeView.Items.Add(root);

            root.ExpandSubtree();

            AreaComboBox.AddHandler(TextBoxBase.TextChangedEvent,
                new TextChangedEventHandler(ComboBox_TextChanged));
        }
예제 #2
0
        public MainWindow(ICatalogManager catMgr, IFinancialManager finMgr)
        {
            InitializeComponent();

            _catMgr = catMgr;
            _finMgr = finMgr;

            var root = new TreeViewItem();

            root.Header = "Tree";

            var child = new TreeViewItem();

            child.Header    = "Initial Data Typing";
            child.Selected += TreeViewItemSelected;
            child.Tag       = typeof(InitialDataTypingView);
            root.Items.Add(child);

            child           = new TreeViewItem();
            child.Header    = "Descriptions";
            child.Selected += TreeViewItemSelected;
            child.Tag       = typeof(DescriptionView);
            root.Items.Add(child);

            MainTreeView.Items.Add(root);

            root.ExpandSubtree();
        }
 public BaseCatalogVariantsRepository(
     IModelProvider modelProvider,
     IStorefrontContext storefrontContext,
     ISiteContext siteContext,
     ISearchInformation searchInformation,
     ISearchManager searchManager,
     ICatalogManager catalogManager,
     ICatalogUrlManager catalogUrlManager,
     IContext context)
 {
     Assert.ArgumentNotNull(modelProvider, nameof(modelProvider));
     Assert.ArgumentNotNull(storefrontContext, nameof(storefrontContext));
     Assert.ArgumentNotNull(siteContext, nameof(siteContext));
     Assert.ArgumentNotNull(searchInformation, nameof(searchInformation));
     Assert.ArgumentNotNull(searchManager, nameof(searchManager));
     Assert.ArgumentNotNull(catalogManager, nameof(catalogManager));
     Assert.ArgumentNotNull(catalogUrlManager, nameof(catalogUrlManager));
     Assert.IsNotNull(context, nameof(context));
     ModelProvider     = modelProvider;
     StorefrontContext = storefrontContext;
     SiteContext       = siteContext;
     SearchInformation = searchInformation;
     SearchManager     = searchManager;
     CatalogManager    = catalogManager;
     CatalogUrlManager = catalogUrlManager;
     Context           = context;
 }
        public GiftCardRepositoryTests()
        {
            _accountManagerMock = Substitute.For <IAccountManager>();
            _catalogManagerMock = Substitute.For <ICatalogManager>();

            _contactFactoryMock = Substitute.For <IContactFactory>();
        }
예제 #5
0
        /// <summary>
        /// Creates a new tile manager.
        /// </summary>
        /// <param name="feedManager">Provides access to remote and local <see cref="Feed"/>s. Handles downloading, signature verification and caching.</param>
        /// <param name="catalogManager">Provides access to remote and local <see cref="Catalog"/>s. Handles downloading, signature verification and caching.</param>
        /// <param name="iconCache">The icon cache used by newly created <see cref="IAppTile"/>s to retrieve application icons.</param>
        /// <param name="tileListMyApps">The <see cref="IAppTileList"/> used to represent the "my apps" <see cref="AppList"/>.</param>
        /// <param name="tileListCatalog">The <see cref="IAppTileList"/> used to represent the merged <see cref="Catalog"/>.</param>
        /// <param name="machineWide">Apply operations machine-wide instead of just for the current user.</param>
        public AppTileManagement([NotNull] IFeedManager feedManager, [NotNull] ICatalogManager catalogManager, [NotNull] IIconCache iconCache, [NotNull] IAppTileList tileListMyApps, [NotNull] IAppTileList tileListCatalog, bool machineWide)
        {
            #region Sanity checks
            if (feedManager == null)
            {
                throw new ArgumentNullException(nameof(feedManager));
            }
            if (catalogManager == null)
            {
                throw new ArgumentNullException(nameof(catalogManager));
            }
            if (iconCache == null)
            {
                throw new ArgumentNullException(nameof(iconCache));
            }
            if (tileListMyApps == null)
            {
                throw new ArgumentNullException(nameof(tileListMyApps));
            }
            if (tileListCatalog == null)
            {
                throw new ArgumentNullException(nameof(tileListCatalog));
            }
            #endregion

            _feedManager    = feedManager;
            _catalogManager = catalogManager;
            _iconCache      = iconCache;

            _tileListMyApps  = tileListMyApps;
            _tileListCatalog = tileListCatalog;
            _machineWide     = machineWide;
        }
예제 #6
0
        public MainWindow(ICatalogManager catMgr, IFinancialManager finMgr)
        {
            InitializeComponent();

            _catMgr = catMgr;
            _finMgr = finMgr;

            var root = new TreeViewItem();

            root.Header = "Tree";

            var child = new TreeViewItem();

            child.Header = "Initial Data Typing";
            root.Items.Add(child);

            child        = new TreeViewItem();
            child.Header = "Descriptions";
            root.Items.Add(child);

            MainTreeView.Items.Add(root);

            root.ExpandSubtree();

            AreaComboBox.AddHandler(TextBoxBase.TextChangedEvent,
                                    new TextChangedEventHandler(ComboBox_TextChanged));
        }
예제 #7
0
        public static Catalog GetCachedSafe([NotNull] this ICatalogManager manager)
        {
            #region Sanity checks
            if (manager == null)
            {
                throw new ArgumentNullException(nameof(manager));
            }
            #endregion

            try
            {
                return(manager.GetCached() ?? new Catalog());
            }
            #region Error handling
            catch (IOException ex)
            {
                Log.Warn(ex.Message);
                return(new Catalog());
            }
            catch (UnauthorizedAccessException ex)
            {
                Log.Warn(ex.Message);
                return(new Catalog());
            }
            catch (InvalidDataException ex)
            {
                Log.Warn(ex.Message);
                return(new Catalog());
            }
            #endregion
        }
예제 #8
0
        public MainWindow(ICatalogManager catMgr)
        {
            InitializeComponent();

            _catMgr = catMgr;

            var root = new TreeViewItem();

            root.Header = "Tree";

            var child = CreateTreeViewItem("Initial Data Typing");

            child.Tag = typeof(InitialDataTypingForm);
            root.Items.Add(child);

            child     = CreateTreeViewItem("Descriptions");
            child.Tag = typeof(DescriptionsForm);
            root.Items.Add(child);

            MainTreeView.Items.Add(root);

            root.ExpandSubtree();

            AreaComboBox.AddHandler(TextBoxBase.TextChangedEvent,
                                    new TextChangedEventHandler(ComboBox_TextChanged));
        }
예제 #9
0
        /// <summary>
        /// Creates a new tile manager.
        /// </summary>
        /// <param name="feedManager">Provides access to remote and local <see cref="Feed"/>s. Handles downloading, signature verification and caching.</param>
        /// <param name="catalogManager">Provides access to remote and local <see cref="Catalog"/>s. Handles downloading, signature verification and caching.</param>
        /// <param name="tileListMyApps">The <see cref="IAppTileList"/> used to represent the "my apps" <see cref="AppList"/>.</param>
        /// <param name="tileListCatalog">The <see cref="IAppTileList"/> used to represent the merged <see cref="Catalog"/>.</param>
        /// <param name="machineWide">Apply operations machine-wide instead of just for the current user.</param>
        public AppTileManagement([NotNull] IFeedManager feedManager, [NotNull] ICatalogManager catalogManager, [NotNull] IAppTileList tileListMyApps, [NotNull] IAppTileList tileListCatalog, bool machineWide)
        {
            #region Sanity checks
            if (feedManager == null)
            {
                throw new ArgumentNullException("feedManager");
            }
            if (catalogManager == null)
            {
                throw new ArgumentNullException("catalogManager");
            }
            if (tileListMyApps == null)
            {
                throw new ArgumentNullException("tileListMyApps");
            }
            if (tileListCatalog == null)
            {
                throw new ArgumentNullException("tileListCatalog");
            }
            #endregion

            _feedManager    = feedManager;
            _catalogManager = catalogManager;

            _tileListMyApps  = tileListMyApps;
            _tileListCatalog = tileListCatalog;
            _machineWide     = machineWide;
        }
예제 #10
0
        public MainWindow(ICatalogManager catMgr, IFinancialManager finMgr)
        {
            InitializeComponent();

            _catMgr = catMgr;
            _finMgr = finMgr;

            var root = new TreeViewItem();
            root.Header = "Tree";

            var child = new TreeViewItem();
            child.Header = "Initial Data Typing";
            child.Selected += TreeViewItemSelected;
            child.Tag = typeof(InitialDataTypingView);
            root.Items.Add(child);

            child = new TreeViewItem();
            child.Header = "Descriptions";
            child.Selected += TreeViewItemSelected;
            child.Tag = typeof(DescriptionView);
            root.Items.Add(child);

            MainTreeView.Items.Add(root);

            root.ExpandSubtree();
        }
예제 #11
0
 public GiftCardRepository(
     IAccountManager accountManager,
     IContactFactory contactFactory,
     ICatalogManager catalogManager)
     : base(accountManager, contactFactory)
 {
     this.CatalogManager = catalogManager;
 }
예제 #12
0
 public SearchRepository(
     IAccountManager accountManager,
     IContactFactory contactFactory,
     ICatalogManager catalogManager)
     : base(accountManager, contactFactory)
 {
     this._catalogManager = catalogManager;
 }
 public CustomEmailRecommendedProductsRepository(
     IModelProvider modelProvider,
     IStorefrontContext storefrontContext,
     ICatalogManager catalogManager,
     IInventoryManager inventoryManager,
     IVisitorContext visitorContext)
     : base(modelProvider, storefrontContext, catalogManager, inventoryManager, visitorContext)
 {
 }
예제 #14
0
        /// <summary>
        /// Creates a new tile manager.
        /// </summary>
        /// <param name="feedManager">Provides access to remote and local <see cref="Feed"/>s. Handles downloading, signature verification and caching.</param>
        /// <param name="catalogManager">Provides access to remote and local <see cref="Catalog"/>s. Handles downloading, signature verification and caching.</param>
        /// <param name="iconStore">The icon store used by newly created <see cref="IAppTile"/>s to retrieve application icons.</param>
        /// <param name="tileListMyApps">The <see cref="IAppTileList"/> used to represent the "my apps" <see cref="AppList"/>.</param>
        /// <param name="tileListCatalog">The <see cref="IAppTileList"/> used to represent the merged <see cref="Catalog"/>.</param>
        /// <param name="machineWide">Apply operations machine-wide instead of just for the current user.</param>
        public AppTileManagement(IFeedManager feedManager, ICatalogManager catalogManager, IIconStore iconStore, IAppTileList tileListMyApps, IAppTileList tileListCatalog, bool machineWide)
        {
            _feedManager    = feedManager ?? throw new ArgumentNullException(nameof(feedManager));
            _catalogManager = catalogManager ?? throw new ArgumentNullException(nameof(catalogManager));
            _iconStore      = iconStore ?? throw new ArgumentNullException(nameof(iconStore));

            _tileListMyApps  = tileListMyApps ?? throw new ArgumentNullException(nameof(tileListMyApps));
            _tileListCatalog = tileListCatalog ?? throw new ArgumentNullException(nameof(tileListCatalog));
            _machineWide     = machineWide;
        }
예제 #15
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _catMgr = IoC.Get<ICatalogManager>();

            var areas = _catMgr.GetAreas();

            foreach (var item in areas)
            {
                AreaComboBox.Items.Add(item.Name);
            }
        }
예제 #16
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _catMgr = IoC.Get <ICatalogManager>();

            var areas = _catMgr.GetAreas();

            foreach (var item in areas)
            {
                AreaComboBox.Items.Add(item.Name);
            }
        }
예제 #17
0
 public CatalogRepository(
     ISiteContext siteContext,
     IStorefrontContext storefrontContext,
     IVisitorContext visitorContext,
     ICatalogManager catalogManager,
     ISitecoreService sitecoreService,
     ISearchManager searchManager,
     ICurrencyProvider currencyProvider)
     : base(currencyProvider, siteContext, storefrontContext, visitorContext, catalogManager, sitecoreService)
 {
     this.searchManager = searchManager;
 }
 public XcProductListRepository(IModelProvider modelProvider,
                                IStorefrontContext storefrontContext,
                                ISiteContext siteContext,
                                ISearchInformation searchInformation,
                                ISearchManager searchManager,
                                ICatalogManager catalogManager,
                                IInventoryManager inventoryManager,
                                ICatalogUrlManager catalogUrlManager,
                                IContext context)
     : base(modelProvider, storefrontContext, siteContext, searchInformation, searchManager, catalogManager, inventoryManager, catalogUrlManager, context)
 {
 }
예제 #19
0
 public XcProductImagesRepository(IModelProvider modelProvider,
                                  IStorefrontContext storefrontContext,
                                  ISiteContext siteContext,
                                  ISearchInformation searchInformation,
                                  ISearchManager searchManager,
                                  ICatalogManager catalogManager,
                                  ICatalogUrlManager catalogUrlManager,
                                  IContext context,
                                  IXcBaseCatalogRepository xcBaseCatalogRepository) :
     base(modelProvider, storefrontContext, siteContext, searchInformation, searchManager, catalogManager, catalogUrlManager, context)
 {
     XcBaseCatalogRepository = xcBaseCatalogRepository;
 }
예제 #20
0
            public Arrangement(bool orderExists, int orderAmount, ICatalogManager catalogManager)
            {
                SUT = new OrderManager(catalogManager);

                if (orderExists)
                {
                    OrderId = Guid.NewGuid();

                    var order = new Dictionary <string, int>();
                    order.Add("Macbook", orderAmount);

                    SUT.AddOrder(OrderId, order);
                }
            }
예제 #21
0
 public CatalogRepository(
     [NotNull] IAccountManager accountManager,
     [NotNull] IContactFactory contactFactory,
     [NotNull] ICartManager cartManager,
     [NotNull] ICatalogManager catalogManager,
     [NotNull] IInventoryManager inventoryManager,
     [NotNull] IPricingManager pricingManager)
     : base(accountManager, contactFactory)
 {
     _cartManager      = cartManager;
     _catalogManager   = catalogManager;
     _inventoryManager = inventoryManager;
     _pricingManager   = pricingManager;
 }
 public BaseCatalogRepository(
     ICurrencyProvider currencyProvider,
     ISiteContext siteContext,
     IStorefrontContext storefrontContext,
     IVisitorContext visitorContext,
     ICatalogManager catalogManager,
     ISitecoreService sitecoreService)
 {
     this.CurrencyProvider  = currencyProvider;
     this.SiteContext       = siteContext;
     this.StorefrontContext = storefrontContext;
     this.VisitorContext    = visitorContext;
     this.CatalogManager    = catalogManager;
     this.SitecoreService   = sitecoreService;
 }
예제 #23
0
        /// <summary>
        /// Creates a new tile manager.
        /// </summary>
        /// <param name="feedManager">Provides access to remote and local <see cref="Feed"/>s. Handles downloading, signature verification and caching.</param>
        /// <param name="catalogManager">Provides access to remote and local <see cref="Catalog"/>s. Handles downloading, signature verification and caching.</param>
        /// <param name="iconCache">The icon cache used by newly created <see cref="IAppTile"/>s to retrieve application icons.</param>
        /// <param name="tileListMyApps">The <see cref="IAppTileList"/> used to represent the "my apps" <see cref="AppList"/>.</param>
        /// <param name="tileListCatalog">The <see cref="IAppTileList"/> used to represent the merged <see cref="Catalog"/>.</param>
        /// <param name="machineWide">Apply operations machine-wide instead of just for the current user.</param>
        public AppTileManagement([NotNull] IFeedManager feedManager, [NotNull] ICatalogManager catalogManager, [NotNull] IIconCache iconCache, [NotNull] IAppTileList tileListMyApps, [NotNull] IAppTileList tileListCatalog, bool machineWide)
        {
            #region Sanity checks
            if (feedManager == null) throw new ArgumentNullException(nameof(feedManager));
            if (catalogManager == null) throw new ArgumentNullException(nameof(catalogManager));
            if (iconCache == null) throw new ArgumentNullException(nameof(iconCache));
            if (tileListMyApps == null) throw new ArgumentNullException(nameof(tileListMyApps));
            if (tileListCatalog == null) throw new ArgumentNullException(nameof(tileListCatalog));
            #endregion

            _feedManager = feedManager;
            _catalogManager = catalogManager;
            _iconCache = iconCache;

            _tileListMyApps = tileListMyApps;
            _tileListCatalog = tileListCatalog;
            _machineWide = machineWide;
        }
 public ProductListRepository(
     ISiteContext siteContext,
     IStorefrontContext storefrontContext,
     IVisitorContext visitorContext,
     ICatalogManager catalogManager,
     ISitecoreService sitecoreService,
     ISearchInformationProvider searchInformationProvider,
     ISettingsProvider settingsProvider,
     ISearchManager searchManager,
     ICurrencyProvider currencyProvider)
     : base(currencyProvider, siteContext, storefrontContext, visitorContext, catalogManager, sitecoreService)
 {
     this.storefrontContext         = storefrontContext;
     this.searchInformationProvider = searchInformationProvider;
     this.settingsProvider          = settingsProvider;
     this.searchManager             = searchManager;
     this.siteContext = siteContext;
 }
예제 #25
0
        public static Catalog GetOnlineSafe([NotNull] this ICatalogManager manager)
        {
            #region Sanity checks
            if (manager == null)
            {
                throw new ArgumentNullException(nameof(manager));
            }
            #endregion

            try
            {
                return(manager.GetOnline());
            }
            #region Error handling
            catch (IOException ex)
            {
                Log.Warn(ex);
                return(new Catalog());
            }
            catch (WebException ex)
            {
                Log.Warn(ex);
                return(new Catalog());
            }
            catch (InvalidDataException ex)
            {
                Log.Warn(ex);
                return(new Catalog());
            }
            catch (SignatureException ex)
            {
                Log.Warn(ex);
                return(new Catalog());
            }
            catch (UriFormatException ex)
            {
                Log.Warn(ex);
                return(new Catalog());
            }
            #endregion
        }
    public static Catalog GetCachedSafe(this ICatalogManager manager)
    {
        #region Sanity checks
        if (manager == null)
        {
            throw new ArgumentNullException(nameof(manager));
        }
        #endregion

        try
        {
            return(manager.GetCached() ?? new());
        }
        #region Error handling
        catch (Exception ex) when(ex is IOException or UnauthorizedAccessException or InvalidDataException)
        {
            Log.Warn(Resources.ErrorLoadingCatalog, ex);
            return(new());
        }
        #endregion
    }
예제 #27
0
    public static Catalog GetOnlineSafe(this ICatalogManager manager)
    {
        #region Sanity checks
        if (manager == null)
        {
            throw new ArgumentNullException(nameof(manager));
        }
        #endregion

        try
        {
            return(manager.GetOnline());
        }
        #region Error handling
        catch (Exception ex) when(ex is UriFormatException or WebException or IOException or UnauthorizedAccessException or InvalidDataException or SignatureException)
        {
            Log.Warn(ex);
            return(new());
        }
        #endregion
    }
}
예제 #28
0
            public Arrangement(bool orders,
                               bool existingUser,
                               IOrderManager orderManager,
                               ICatalogManager catalogManager)
            {
                SUT = new UserManager(orderManager, catalogManager);

                if (existingUser)
                {
                    var user = new UserDetailsModel()
                    {
                        FirstName = "First",
                        Surname   = "Second",
                        UserId    = UserId = Guid.NewGuid()
                    };

                    SUT.AddUser(user);
                }

                if (orders)
                {
                    SUT.AddOrder(UserId, Guid.NewGuid());
                }
            }
예제 #29
0
        public MainWindow(ICatalogManager catMgr)
        {
            InitializeComponent();

            _catMgr = catMgr;

            var root = new TreeViewItem();
            root.Header = "Tree";

            var child = CreateTreeViewItem("Initial Data Typing");
            child.Tag = typeof(InitialDataTypingForm);
            root.Items.Add(child);

            child = CreateTreeViewItem("Descriptions");
            child.Tag = typeof(DescriptionsForm);
            root.Items.Add(child);

            MainTreeView.Items.Add(root);

            root.ExpandSubtree();

            AreaComboBox.AddHandler(TextBoxBase.TextChangedEvent,
                new TextChangedEventHandler(ComboBox_TextChanged));
        }
예제 #30
0
 public UpdateCatalogHandler(ICatalogManager catalogManager)
 {
     this.catalogManager = catalogManager ??
                           throw new ArgumentNullException(nameof(catalogManager));
 }
 public PurchasableProductListRepository(IModelProvider modelProvider, IStorefrontContext storefrontContext, ISiteContext siteContext, ISearchInformation searchInformation, ISearchManager searchManager, ICatalogManager catalogManager, IInventoryManager inventoryManager, ICatalogUrlManager catalogUrlManager, IContext context, IProductListCacheProvider productListCacheProvider, IBulkManager bulkManager)
     : base(modelProvider, storefrontContext, siteContext, searchInformation, searchManager, catalogManager, inventoryManager, catalogUrlManager, context, productListCacheProvider, bulkManager)
 {
     _storefrontContext = storefrontContext;
 }
예제 #32
0
 public AddProductSupplierCommand(IConfiguration configuration, ICatalogManager catalogManager) : base(
         "addProductSupplier", "Adds a new supplier with barcodes for an existing product to acquiree catalog")
 {
     _configuration  = configuration;
     _catalogManager = catalogManager;
 }
예제 #33
0
 public OrderManager(ICatalogManager catalogManager)
 {
     this.catalogManager = catalogManager ??
                           throw new ArgumentNullException(nameof(catalogManager));
 }
예제 #34
0
 public CartManager(ICatalogManager catalog)
 {
     this.catalog = catalog ?? throw new ArgumentNullException(nameof(catalog));
 }
예제 #35
0
 public CatalogController(IMapper mapper, ICatalogManager catalogManager) : base(mapper)
 {
     _catalogManager = catalogManager;
 }