示例#1
0
 public static void Initialize(
     ILocalStoreDataService <ProductCategory> categoryStorageService,
     ILocalStoreDataService <Product> productStorageService,
     ILocalStoreDataService <string> defaultFavoritesStorageService
     )
 {
     CategoryDataSource         = new CategoryDataSource(categoryStorageService);
     ProductDataSource          = new ProductDataSource(productStorageService);
     DefaultFavoritesDataSource = new DefaultFavoritesDataSource(defaultFavoritesStorageService);
     _isInitialized             = true;
 }
 public DefaultFavoritesDataSource(ILocalStoreDataService <string> storageService)
 {
     storageService.SourcePath = Constants.DefaultFavoritesFile;
     _storageService           = storageService;
 }
 public CategoryDataSource(ILocalStoreDataService <ProductCategory> storageService)
 {
     storageService.SourcePath = Constants.CategoryFile;
     _storageService           = storageService;
 }
 public ProductDataSource(ILocalStoreDataService <Product> storageService)
 {
     storageService.SourcePath = Constants.ProductFile;
     _storageService           = storageService;
 }