Example #1
0
        private static void InitializeConfigManager(ConfigManagerSettings configManagerSettings)
        {
            InitJsonSettings(configManagerSettings.Required);

            SetBuildInConfig(configManagerSettings);

            OverrideConfigIfConfigFileFound(configManagerSettings);
        }
Example #2
0
        private static void OverrideConfigIfConfigFileFound(ConfigManagerSettings configManagerSettings)
        {
            var configJson = EmbeddedResourceHelper.Load(configManagerSettings.MasterFile, configManagerSettings.Assembly);

            if (!string.IsNullOrWhiteSpace(configJson))
            {
                SetConfig(configJson);
            }
        }
Example #3
0
        public static void Init(ConfigManagerSettings configManagerSettings)
        {
            if (configManagerSettings?.Assembly == null)
            {
                throw new ArgumentNullException(nameof(Assembly), "Assembly Cannot be null");
            }

            InitializeConfigManager(configManagerSettings);
        }
Example #4
0
        private static void SetBuildInConfig(ConfigManagerSettings configManagerSettings)
        {
            var configFile = configManagerSettings.DebugFile;

#if !DEBUG
            configFile = configManagerSettings.ReleaseFile;
#endif
            var configJson = EmbeddedResourceHelper.Load(configFile, configManagerSettings.Assembly);
            if (!string.IsNullOrWhiteSpace(configJson))
            {
                SetConfig(configJson);
            }
        }