/// <exception cref="ArgumentNullException">
        /// <paramref name="htmlLoader" /> or
        /// <paramref name="parser" /> or
        /// <paramref name="backupProcessor" /> or
        /// <paramref name="httpDownloadManager" /> or
        /// <paramref name="dataService" /> or
        /// <paramref name="fileSystemProxy" /> is <see langword="null" />.</exception>
        internal PluralsightCatalog(IHtmlLoader htmlLoader,
                                    ITrainingCatalogParser <PluralsightCategory, PluralsightCourse, PluralsightAuthor> parser,
                                    ICatalogBackupProcessor <PluralsightCategory, PluralsightCourse, PluralsightAuthor> backupProcessor,
                                    IHttpDownloadManager httpDownloadManager,
                                    IPluralsightDataService dataService,
                                    IFileSystemProxy fileSystemProxy)
            : base(httpDownloadManager, fileSystemProxy)
        {
            if (htmlLoader == null)
            {
                throw new ArgumentNullException("htmlLoader");
            }

            if (parser == null)
            {
                throw new ArgumentNullException("parser");
            }

            if (backupProcessor == null)
            {
                throw new ArgumentNullException("backupProcessor");
            }

            if (dataService == null)
            {
                throw new ArgumentNullException("dataService");
            }

            _htmlLoader      = htmlLoader;
            _parser          = parser;
            _backupProcessor = backupProcessor;
            _dataService     = dataService;
        }
示例#2
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="updateParseResult" /> or
        /// <paramref name="dataService" /> is <see langword="null" />.</exception>
        public PluralsightChangesProcessor(
            IUpdateContentParseResult <PluralsightCategory, PluralsightCourse, PluralsightAuthor> updateParseResult,
            IPluralsightDataService dataService)
            : base(updateParseResult)
        {
            if (dataService == null)
            {
                throw new ArgumentNullException("dataService");
            }

            _dataService = dataService;
        }
        CreateChangesProcessor(IUpdateContentParseResult <PluralsightCategory, PluralsightCourse, PluralsightAuthor> updateParseResult,
                               bool useArchiveData)
        {
            if (_dataService == null)
            {
                _dataService = useArchiveData
               ? new PluralsightArchiveDataService(ArchiveFolderPath, FileSystemProxy)
               : (IPluralsightDataService)
                               new PluralsightWebDataService(ArchiveCurrentSaveDirectory, HttpDownloadManager, FileSystemProxy);
            }

            var changesProcessor = new PluralsightChangesProcessor(updateParseResult, _dataService);

            return(changesProcessor);
        }