コード例 #1
0
        public BlogSyncServicePostsHelper(BlogSyncConfiguration config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            this.config = config;
        }
コード例 #2
0
ファイル: BlogSyncService.cs プロジェクト: sebnilsson/Blaven
        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;
        }