public BlogSyncServicePostsHelper(BlogSyncConfiguration config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            this.config = config;
        }
예제 #2
0
        public BlogSyncService(BlogSyncConfiguration config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            this.Config = config;

            this.blogSettings = new BlogSettingsHelper(config.BlogSettings);

            this.metaHelper = new BlogSyncServiceMetaHelper(config);
            this.postsHelper = new BlogSyncServicePostsHelper(config);
        }
예제 #3
0
        private static BlogSyncService GetBlogSyncService(IDocumentStore documentStore)
        {
            if (documentStore == null)
            {
                throw new ArgumentNullException(nameof(documentStore));
            }

            var blogSource = AppSettingsFactory.BuildBlogSource((username, password) => new BloggerBlogSource(password));

            var dataStorage = new RavenDbDataStorage(documentStore);

            var syncConfig = new BlogSyncConfiguration(blogSource, dataStorage, blogSettings: BlogSettingsLazy.Value);

            syncConfig.TransformersProvider.Transformers.Clear();

            var blogSync = new BlogSyncService(syncConfig);
            return blogSync;
        }
예제 #4
0
        internal static BlogSyncConfiguration Create(
            IBlogSource blogSource,
            IDataStorage dataStorage,
            IEnumerable<BlogSetting> blogSettings)
        {
            if (blogSource == null)
            {
                throw new ArgumentNullException(nameof(blogSource));
            }
            if (dataStorage == null)
            {
                throw new ArgumentNullException(nameof(dataStorage));
            }

            var config = new BlogSyncConfiguration(
                             blogSource,
                             dataStorage,
                             slugProvider: null,
                             blavenIdProvider: null,
                             transformersProvider: null,
                             blogSettings: blogSettings);
            return config;
        }