Пример #1
0
        static AbstractTest()
        {
            var kernel = new StandardKernel();

            try {
                AnAuctionSiteFactory = LoadSiteFactoryFromModule();
            }
            catch (Exception e) {
                Console.WriteLine(e);
            }
        }
Пример #2
0
#pragma warning disable CS0246 // Il nome di tipo o di spazio dei nomi 'ISiteFactory' non è stato trovato. Probabilmente manca una direttiva using o un riferimento all'assembly.
        public static ISiteFactory LoadSiteFactoryFromModule()
        {
#pragma warning restore CS0246 // Il nome di tipo o di spazio dei nomi 'ISiteFactory' non è stato trovato. Probabilmente manca una direttiva using o un riferimento all'assembly.
            var          kernel = new StandardKernel();
            ISiteFactory result = null;
            try {
                kernel.Load(Configuration.ImplementationAssembly);
                result = kernel.Get <ISiteFactory>();
            }
            catch (Exception e) {
                Console.WriteLine(e);
            }

            return(result);
        }
Пример #3
0
        public static ISiteFactory LoadSiteFactoryFromModule()
        {
            var          kernel = new StandardKernel();
            ISiteFactory result = null;

            try {
                kernel.Load(Configuration.ImplementationAssembly);
                result = kernel.Get <ISiteFactory>();
            }
            catch (Exception e) {
                Console.WriteLine(e);
            }

            return(result);
        }
Пример #4
0
        static async Task Start(string item, ISiteFactory factory, List <ThomannItemModel> list, Action <ThomannItemModel> a)
        {
            await Task.Run(() =>
            {
                var model = new ThomannItemModel()
                {
                    Prices = new Dictionary <string, string>()
                };
                model.Url = factory.CreateSwedishSite().ScrapeUrl(item);
                if (!string.IsNullOrEmpty(model.Url))
                {
                    model.Prices.Add("SEK", factory.CreateSwedishSite().ScrapeSwedishInfo(model.Url));
                    model.Prices.Add("DKK", factory.CreateDanishSite().ScrapeDanishInfo(model.Url.Replace("/se/", "/dk/")));
                    model.Prices.Add("NOK", factory.CreateNorwegianSite().ScrapeNorwegianInfo(model.Url.Replace("/se/", "/de/")));
                    model.Prices.Add("EUR", factory.CreateGermanSite().ScrapeGermanInfo(model.Url.Replace("/se/", "/de/")));

                    a(model);
                    list.Add(model);
                }
            });
        }
Пример #5
0
 public void InitSiteFactory()
 {
     siteFactory      = this.GetSiteFactory();
     connectionString = this.GetConnectionString();
     siteFactory.Setup(connectionString);
 }
Пример #6
0
 public Overview(ISiteFactory siteFactory)
 {
     this.siteFactory = new SiteFactory();
 }
Пример #7
0
 public SiteCreatedHandler(IVmsLogger <SiteCreatedHandler> logger, ISiteFactory factory, ISiteRepository siteRepository)
 {
     _logger         = logger;
     _factory        = factory;
     _siteRepository = siteRepository;
 }
Пример #8
0
 public SiteService(IAppUnitOfWork uow, ISiteFactory siteFactory)
 {
     _uow         = uow;
     _siteFactory = siteFactory;
 }
 public SiteManager(ISiteFactory siteFactory, ISiteStorage siteStorage)
 {
     this.siteFactory = siteFactory;
     this.siteStorage = siteStorage;
     siteStorage.AddPullCompleteEventListener(UpdateSites);
 }