Пример #1
0
        private TestableMetaBlogApi CreateAuthenticatingApi(
            IBlogManager blogManager         = null,
            ICategoryManager categoryManager = null,
            IEntryManager entryManager       = null,
            IWeBlogSettings settings         = null,
            BaseMediaManager mediaManager    = null,
            BaseLinkManager linkManager      = null
            )
        {
            IBlogSettingsResolver settingsResolver = null;

            if (settings != null)
            {
                settingsResolver = Mock.Of <IBlogSettingsResolver>(x =>
                                                                   x.Resolve(It.IsAny <BlogHomeItem>()) == new BlogSettings(settings)
                                                                   );
            }

            return(new TestableMetaBlogApi(
                       blogManager,
                       categoryManager,
                       entryManager,
                       settings,
                       mediaManager,
                       linkManager,
                       settingsResolver
                       )
            {
                AuthenticateFunction = (u, p) => { }
            });
        }
Пример #2
0
 public AkismetSpamCheck(IWeBlogSettings settings, IBlogManager blogManager, IAkismet akismetApi, BaseLinkManager linkManager)
 {
     _settings    = settings ?? WeBlogSettings.Instance;
     _blogManager = blogManager ?? ManagerFactory.BlogManagerInstance;
     _akismetApi  = akismetApi;
     _linkManager = linkManager ?? ServiceLocator.ServiceProvider.GetService(typeof(BaseLinkManager)) as BaseLinkManager;
 }
Пример #3
0
 private BlogManager CreateBlogManager(BaseLinkManager linkManager = null, IWeBlogSettings settings = null, BaseTemplateManager templateManager = null)
 {
     return(new BlogManager(
                linkManager ?? Mock.Of <BaseLinkManager>(),
                templateManager ?? Mock.Of <BaseTemplateManager>(),
                settings ?? Mock.Of <IWeBlogSettings>()));
 }
Пример #4
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="currentBlog">The blog being listed.</param>
 /// <param name="settings">The settings to use. If null, the default settings will be used.</param>
 /// <param name="authorsCore">The <see cref="IAuthorsCore"/> component to use to retrieve author information.</param>
 /// <param name="entryManager">The <see cref="IEntryManager"/> to use to access entries.</param>
 /// <param name="templateManager">The <see cref="BaseTemplateManager"/> to use to access templates.</param>
 public PostListCore(BlogHomeItem currentBlog, IWeBlogSettings settings = null, IAuthorsCore authorsCore = null, IEntryManager entryManager = null, BaseTemplateManager templateManager = null)
 {
     CurrentBlog     = currentBlog;
     Settings        = settings ?? WeBlogSettings.Instance;
     AuthorsCore     = authorsCore ?? new AuthorsCore(CurrentBlog);
     EntryManager    = entryManager ?? ManagerFactory.EntryManagerInstance;
     TemplateManager = templateManager ?? ServiceLocator.ServiceProvider.GetService(typeof(BaseTemplateManager)) as BaseTemplateManager;
 }
Пример #5
0
        public FeedResolver(BaseTemplateManager templateManager, IWeBlogSettings weBlogSettings)
        {
            Assert.ArgumentNotNull(templateManager, nameof(templateManager));
            Assert.ArgumentNotNull(weBlogSettings, nameof(weBlogSettings));

            TemplateManager = templateManager;
            WeBlogSettings  = weBlogSettings;
        }
Пример #6
0
 public EntryManager(
     ReportDataProviderBase reportDataProvider,
     IEntrySearchCache cache,
     IWeBlogSettings settings       = null,
     ICommentManager commentManager = null)
     : this(reportDataProvider, cache, settings, commentManager, null)
 {
 }
Пример #7
0
 public MetaBlogApi(
     IBlogManager blogManager,
     ICategoryManager categoryManager,
     IEntryManager entryManager,
     IWeBlogSettings settings,
     BaseMediaManager mediaManager,
     BaseLinkManager linkManager)
 {
 }
Пример #8
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="settings">The settings to use, or pass null to use the default settings.</param>
 /// <param name="templateManager">The <see cref="BaseTemplateManager"/> used to access templates.</param>
 /// <param name="blogSettingsResolver">The resolver used to resolve settings for specific blogs.</param>
 /// <param name="eventQueue">The event queue to submit new comments to.</param>
 public CommentManager(
     IWeBlogSettings settings = null,
     IWeBlogCommentSettings commentSettings     = null,
     BaseTemplateManager templateManager        = null,
     IBlogSettingsResolver blogSettingsResolver = null,
     BaseEventQueueProvider eventQueue          = null)
 {
     Settings             = settings ?? WeBlogSettings.Instance;
     CommentSettings      = commentSettings ?? ServiceLocator.ServiceProvider.GetRequiredService <IWeBlogCommentSettings>();
     TemplateManager      = templateManager ?? ServiceLocator.ServiceProvider.GetRequiredService <BaseTemplateManager>();
     BlogSettingsResolver = blogSettingsResolver ?? ServiceLocator.ServiceProvider.GetRequiredService <IBlogSettingsResolver>();
     EventQueue           = eventQueue ?? ServiceLocator.ServiceProvider.GetRequiredService <BaseEventQueueProvider>();
 }
Пример #9
0
 public EntryManager(
     ReportDataProviderBase reportDataProvider,
     IEntrySearchCache cache,
     IWeBlogSettings settings                   = null,
     ICommentManager commentManager             = null,
     BaseTemplateManager templateManager        = null,
     IBlogSettingsResolver blogSettingsResolver = null)
 {
     ReportDataProvider   = reportDataProvider;
     Settings             = settings ?? WeBlogSettings.Instance;
     EntryCache           = cache ?? CacheManager.GetCache <IEntrySearchCache>(EntrySearchCache.CacheName);
     CommentManager       = commentManager ?? ServiceLocator.ServiceProvider.GetRequiredService <ICommentManager>();
     TemplateManager      = templateManager ?? ServiceLocator.ServiceProvider.GetRequiredService <BaseTemplateManager>();
     BlogSettingsResolver = blogSettingsResolver ?? ServiceLocator.ServiceProvider.GetRequiredService <IBlogSettingsResolver>();
 }
Пример #10
0
 public MetaBlogApi(
     IBlogManager blogManager,
     ICategoryManager categoryManager,
     IEntryManager entryManager,
     IWeBlogSettings settings,
     BaseMediaManager mediaManager,
     BaseLinkManager linkManager,
     IBlogSettingsResolver blogSettingsResolver)
 {
     BlogManager          = blogManager ?? ServiceLocator.ServiceProvider.GetRequiredService <IBlogManager>();
     CategoryManager      = categoryManager ?? ServiceLocator.ServiceProvider.GetRequiredService <ICategoryManager>();
     EntryManager         = entryManager ?? ServiceLocator.ServiceProvider.GetRequiredService <IEntryManager>();
     Settings             = settings ?? ServiceLocator.ServiceProvider.GetRequiredService <IWeBlogSettings>();
     MediaManager         = mediaManager ?? ServiceLocator.ServiceProvider.GetRequiredService <BaseMediaManager>();
     LinkManager          = linkManager ?? ServiceLocator.ServiceProvider.GetRequiredService <BaseLinkManager>();
     BlogSettingsResolver = blogSettingsResolver ?? ServiceLocator.ServiceProvider.GetRequiredService <IBlogSettingsResolver>();
 }
Пример #11
0
 public TestableMetaBlogApi(
     IBlogManager blogManager                   = null,
     ICategoryManager categoryManager           = null,
     IEntryManager entryManager                 = null,
     IWeBlogSettings settings                   = null,
     BaseMediaManager mediaManager              = null,
     BaseLinkManager linkManager                = null,
     IBlogSettingsResolver blogSettingsResolver = null
     )
     : base(
         blogManager ?? Mock.Of <IBlogManager>(),
         categoryManager ?? Mock.Of <ICategoryManager>(),
         entryManager ?? Mock.Of <IEntryManager>(),
         settings ?? Mock.Of <IWeBlogSettings>(),
         mediaManager ?? Mock.Of <BaseMediaManager>(),
         linkManager ?? Mock.Of <BaseLinkManager>(),
         blogSettingsResolver ?? Mock.Of <IBlogSettingsResolver>()
         )
 {
 }
Пример #12
0
 public WorkflowSubmit(IWeBlogSettings settings, IWeBlogCommentSettings commentSettings)
 {
     _settings        = settings;
     _commentSettings = commentSettings ?? ServiceLocator.ServiceProvider.GetRequiredService <IWeBlogCommentSettings>();
 }
Пример #13
0
 public BlogHomeItem(Item innerItem, IWeBlogSettings settings = null)
     : base(innerItem)
 {
     Settings = settings;
 }
Пример #14
0
 public BlogHomeItem(Item innerItem, BaseLinkManager linkManager, IWeBlogSettings settings = null)
     : base(innerItem)
 {
     Settings = settings;
 }
Пример #15
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="settings">The settings to use. If null, the default settings are used.</param>
 public BlogManager(BaseLinkManager linkManager, BaseTemplateManager templateManager, IWeBlogSettings settings = null)
 {
     LinkManager     = linkManager ?? ServiceLocator.ServiceProvider.GetRequiredService <BaseLinkManager>();
     TemplateManager = templateManager ?? ServiceLocator.ServiceProvider.GetRequiredService <BaseTemplateManager>();
     Settings        = settings ?? WeBlogSettings.Instance;
 }
Пример #16
0
 public EntryManager(ReportDataProviderBase reportDataProvider, IWeBlogSettings settings)
 {
     ReportDataProvider = reportDataProvider;
     Settings = settings ?? new WeBlogSettings();
 }
Пример #17
0
 public BlogManager(IWeBlogSettings settings = null)
     : this(null, null, settings)
 {
 }
Пример #18
0
 public BlogManager(BaseLinkManager linkManager, IWeBlogSettings settings = null)
     : this(linkManager, null, settings)
 {
 }
Пример #19
0
 public EntryManager(IWeBlogSettings settings)
 {
     Settings = settings ?? new WeBlogSettings();
 }
Пример #20
0
 public TranslatorCache(string cacheName, IWeBlogSettings settings = null)
 {
     CacheNamePrefix = cacheName;
     _settings       = settings ?? WeBlogSettings.Instance;
 }
Пример #21
0
 public ShareEntryShareThis(IWeBlogSettings settings)
 {
     _settings = settings;
 }
Пример #22
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="settings">The settings to use. If null, the default settings are used.</param>
 /// <param name="templateManager">The <see cref="BaseTemplateManager"/> used to access templates.</param>
 public CategoryManager(IWeBlogSettings settings = null, BaseTemplateManager templateManager = null)
 {
     Settings        = settings ?? WeBlogSettings.Instance;
     TemplateManager = templateManager ?? ServiceLocator.ServiceProvider.GetService(typeof(BaseTemplateManager)) as BaseTemplateManager;
 }
Пример #23
0
 public EntryManager(IWeBlogSettings settings)
 {
     Settings = settings ?? new WeBlogSettings();
 }
Пример #24
0
 public CommentManager(IWeBlogSettings settings = null)
     : this(settings, null)
 {
 }
Пример #25
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="settings">The settings to use, or pass null to use the default settings.</param>
 public CommentManager([CanBeNull] IWeBlogSettings settings = null)
 {
     Settings = settings ?? new WeBlogSettings();
 }
Пример #26
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="settings">The settings to use. If null, the default settings will be used.</param>
 public BlogManager(IWeBlogSettings settings = null)
 {
     Settings = settings ?? new WeBlogSettings();
 }
Пример #27
0
 public WorkflowSubmit(IWeBlogSettings settings)
 {
     _settings = settings;
 }
Пример #28
0
 public CategoryManager(IWeBlogSettings settings = null)
     : this(settings, null)
 {
 }
Пример #29
0
 public ItemAndPublishEventHandler(IWeBlogSettings settings, BaseTemplateManager templateManager)
 {
     _settings        = settings ?? WeBlogSettings.Instance;
     _templateManager = templateManager ?? ServiceLocator.ServiceProvider.GetRequiredService <BaseTemplateManager>();
 }
Пример #30
0
 public CommentsListCore(BlogHomeItem currentBlogHomeItem, EntryItem currentEntry, IWeBlogSettings settings = null, ICommentManager commentManager = null)
 {
     CurrentBlog    = currentBlogHomeItem;
     CurrentEntry   = currentEntry;
     Settings       = settings ?? WeBlogSettings.Instance;
     CommentManager = commentManager ?? ManagerFactory.CommentManagerInstance;
 }
Пример #31
0
 public Captcha(IWeBlogSettings settings)
 {
     Settings = settings;
 }
Пример #32
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="settings">The settings to use. If null, the default settings will be used.</param>
 public BlogManager(IWeBlogSettings settings = null)
 {
     Settings = settings ?? new WeBlogSettings();
 }
Пример #33
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="settings">The settings to use. If null, the default settings are used.</param>
 public CategoryManager(IWeBlogSettings settings = null)
 {
     Settings = settings ?? new WeBlogSettings();
 }