Exemplo n.º 1
0
        /// <summary>
        /// Import products using given parameters
        /// </summary>
        IProductType[] IProductImporter.Import(IImportParameters parameters)
        {
            var products = Import((TParameters)parameters);

            Parameters = GenerateParameters();
            return(products);
        }
        public IReadOnlyList <IProductType> ImportTypes(string importerName, IImportParameters parameters)
        {
            var importer = _importers.First(i => i.Name == importerName);
            var imported = importer.Import(parameters);

            foreach (var product in imported)
            {
                SaveType(product);
            }
            return(imported);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Update parameters based on partial input
 /// </summary>
 IImportParameters IProductImporter.Update(IImportParameters currentParameters)
 {
     return(Update((TParameters)currentParameters));
 }
Exemplo n.º 4
0
        /// <summary>
        /// Initialize this component with its config
        /// </summary>
        /// <param name="config">Config of this module plugin</param>
        public virtual void Initialize(ProductImporterConfig config)
        {
            Config = (TConfig)config;

            Parameters = GenerateParameters();
        }
        public ProductModel ImportProduct(string importerName, IImportParameters parameters)
        {
            var products = ProductManager.ImportTypes(importerName, parameters);

            return(ConvertProduct(products[0], false));
        }
 private static Entry ConvertParameters(IImportParameters parametersObject) =>
 EntryConvert.EncodeObject(parametersObject, new PartialSerialization <IImportParameters>());
Exemplo n.º 7
0
 public IReadOnlyList <IProductType> ImportTypes(string importerName, IImportParameters parameters)
 {
     ValidateHealthState();
     return(ProductManager.ImportTypes(importerName, parameters));
 }