Example #1
0
 /// <summary>
 /// ConfigurationObjectProviderJson class
 /// </summary>
 /// <param name="globalWebsiteConfig"></param>
 /// <exception cref="ConfigurationObjectProviderJsonException"></exception>
 public ConfigurationObjectProviderJson(GlobalWebsiteConfig globalWebsiteConfig, string jsonPath = "jasper.json")
 {
     this.GlobalWebsiteConfig = globalWebsiteConfig ?? throw new ConfigurationObjectProviderJsonException();
     if (!string.IsNullOrWhiteSpace(jsonPath))
     {
         _jsonPath = jsonPath;
     }
     else
     {
         throw new ConfigurationObjectProviderJsonException();
     }
 }
Example #2
0
        public static void Initialize()
        {
            // Global jasper.json file is mapped to config classes
            GlobalConfigDataProviderJson globalJsonProvider = new GlobalConfigDataProviderJson("jasper.json");
            GlobalWebsiteConfig          globalConfig       = new GlobalWebsiteConfig(globalJsonProvider);

            // Theme jasper.json file is mapped to theme config classes
            // Theme jasper.json file depends on global settings of theme folder location
            ConfigurationObjectProviderJson configurationObjectJsonProvider = new ConfigurationObjectProviderJson(globalConfig, "jasper.json");
            WebsiteConfig websiteConfig = new WebsiteConfig(configurationObjectJsonProvider);

            // Custom routing manager
            CustomRouting customRouting = new CustomRouting(websiteConfig, globalConfig);

            // Theme helper manager
            ThemeHelper themeHelper = new ThemeHelper();

            // Assigning variables of this static class - cross request persistent
            GlobalWebsiteConfig = globalConfig;
            WebsiteConfig       = websiteConfig;
            CustomRouting       = customRouting;
            ThemeHelper         = themeHelper;
        }
Example #3
0
 public CustomRouting(WebsiteConfig websiteConfig, GlobalWebsiteConfig globalWebsiteConfig)
 {
     this.WebsiteConfig       = websiteConfig;
     this.GlobalWebsiteConfig = globalWebsiteConfig;
 }