Exemplo n.º 1
0
        public BlogConfig(IDbConnection dbConnection)
        {
            _dbConnection = dbConnection;

            ContentSettings          = new();
            GeneralSettings          = new();
            NotificationSettings     = new();
            FeedSettings             = new();
            ImageSettings            = new();
            AdvancedSettings         = new();
            CustomStyleSheetSettings = new();

            Initialize();
        }
Exemplo n.º 2
0
        public BlogConfig(
            ILogger <BlogConfig> logger,
            IDbConnection dbConnection)
        {
            _dbConnection = dbConnection;
            _logger       = logger;

            ContentSettings          = new();
            GeneralSettings          = new();
            NotificationSettings     = new();
            FeedSettings             = new();
            WatermarkSettings        = new();
            FriendLinksSettings      = new();
            AdvancedSettings         = new();
            CustomStyleSheetSettings = new();

            Initialize();
        }
Exemplo n.º 3
0
        private void Initialize()
        {
            if (_hasInitialized)
            {
                return;
            }

            var cfgDic = GetAllConfigurations();

            GeneralSettings          = cfgDic[nameof(GeneralSettings)].FromJson <GeneralSettings>();
            ContentSettings          = cfgDic[nameof(ContentSettings)].FromJson <ContentSettings>();
            NotificationSettings     = cfgDic[nameof(NotificationSettings)].FromJson <NotificationSettings>();
            FeedSettings             = cfgDic[nameof(FeedSettings)].FromJson <FeedSettings>();
            ImageSettings            = cfgDic[nameof(ImageSettings)].FromJson <ImageSettings>();
            AdvancedSettings         = cfgDic[nameof(AdvancedSettings)].FromJson <AdvancedSettings>();
            CustomStyleSheetSettings = cfgDic[nameof(CustomStyleSheetSettings)].FromJson <CustomStyleSheetSettings>();

            _hasInitialized = true;
        }
Exemplo n.º 4
0
        private void Initialize()
        {
            if (_hasInitialized)
            {
                return;
            }

            var cfgDic = GetAllConfigurations();

            GeneralSettings          = cfgDic[nameof(GeneralSettings)].FromJson <GeneralSettings>();
            ContentSettings          = cfgDic[nameof(ContentSettings)].FromJson <ContentSettings>();
            NotificationSettings     = cfgDic[nameof(NotificationSettings)].FromJson <NotificationSettings>();
            FeedSettings             = cfgDic[nameof(FeedSettings)].FromJson <FeedSettings>();
            WatermarkSettings        = cfgDic[nameof(WatermarkSettings)].FromJson <WatermarkSettings>();
            FriendLinksSettings      = cfgDic[nameof(FriendLinksSettings)].FromJson <FriendLinksSettings>();
            AdvancedSettings         = cfgDic[nameof(AdvancedSettings)].FromJson <AdvancedSettings>();
            SecuritySettings         = cfgDic[nameof(SecuritySettings)].FromJson <SecuritySettings>();
            CustomStyleSheetSettings = cfgDic[nameof(CustomStyleSheetSettings)].FromJson <CustomStyleSheetSettings>();

            _hasInitialized = true;
        }