コード例 #1
0
ファイル: BlogConfig.cs プロジェクト: MaQuanXin/Moonglade
    public BlogConfig(IDbConnection dbConnection)
    {
        _dbConnection = dbConnection;

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

        Initialize();
    }
コード例 #2
0
ファイル: BlogConfig.cs プロジェクト: MaQuanXin/Moonglade
    private void Initialize()
    {
        if (_hasInitialized)
        {
            return;
        }

        var config = GetAllConfigurations();

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

        _hasInitialized = true;
    }
コード例 #3
0
 public void OnGet()
 {
     ViewModel = _blogConfig.CustomStyleSheetSettings;
 }