Ejemplo n.º 1
0
        public void Initialize()
        {
            //Need to setup the logger first
            if (LoggingEnabled)
                LoggerProvider = Options.LoggerProvider ?? new SystemLoggerProviderLog4Net(this);

            _logger = LoggerProvider.CreateLogger(typeof(Settings));

            //Setting up the rest of the system
            _logger.Info("Settings - Setup Started");
            _logger.Debug(() => string.Format("Settings - Settings Extension Options - {0}", Options));

            var sqlFactory = new SqlFactory();

            var feedProvider = new NugetReleaseFeedProvider();
            var persistencyProvider = new ReleasePersistencyProvider(sqlFactory);
 
            QueryProvider = new CacheReleaseQueryProvider();
            ReleaseQueryService = new ReleaseQueryService(QueryProvider);
            if (UseOfflineData)
                RefreshReleaseRepositoryService = new RefreshReleaseRepositoryOfflineService(NugetListingPath); 
            else
                RefreshReleaseRepositoryService = new RefreshReleaseRepositoryService(feedProvider, persistencyProvider);
            RefreshReleaseService = new RefreshReleaseService(this, RefreshReleaseRepositoryService, QueryProvider);
            ReleaseService = new ReleaseService(QueryProvider);

            _logger.Info("Settings - Setup Finished");

            //Run system setup
            _logger.Info("Settings - Pre Initialize");
             
            RefreshReleaseService.Execute(true);

            _logger.Info("Settings - Post Initialize");
        }
Ejemplo n.º 2
0
        public void Initialize()
        {
            //Need to setup the logger first
            if (LoggingEnabled)
            {
                LoggerProvider = Options.LoggerProvider ?? new SystemLoggerProviderLog4Net(this);
            }

            _logger = LoggerProvider.CreateLogger(typeof(Settings));

            //Setting up the rest of the system
            _logger.Info("Settings - Setup Started");
            _logger.Debug(() => string.Format("Settings - Settings Extension Options - {0}", Options));

            var sqlFactory = new SqlFactory();

            var feedProvider        = new NugetReleaseFeedProvider();
            var persistencyProvider = new ReleasePersistencyProvider(sqlFactory);

            QueryProvider       = new CacheReleaseQueryProvider();
            ReleaseQueryService = new ReleaseQueryService(QueryProvider);
            if (UseOfflineData)
            {
                RefreshReleaseRepositoryService = new RefreshReleaseRepositoryOfflineService(NugetListingPath);
            }
            else
            {
                RefreshReleaseRepositoryService = new RefreshReleaseRepositoryService(feedProvider, persistencyProvider);
            }
            RefreshReleaseService = new RefreshReleaseService(this, RefreshReleaseRepositoryService, QueryProvider);
            ReleaseService        = new ReleaseService(QueryProvider);

            _logger.Info("Settings - Setup Finished");

            //Run system setup
            _logger.Info("Settings - Pre Initialize");

            RefreshReleaseService.Execute(true);

            _logger.Info("Settings - Post Initialize");
        }