private bool IsPropertyExistsInSources(string propertyName)
        {
            if (_discoveredProperties.ContainsKey(propertyName))
            {
                return(_discoveredProperties[propertyName]);
            }

            string cmdLineArgValue = ChoEnvironment.GetCmdLineArgValue(propertyName);

            if (!cmdLineArgValue.IsNullOrWhiteSpace())
            {
                ChoETLFramework.WriteLog("'{0}' property discovered via command line argument.".FormatString(propertyName));
                _discoveredProperties.Add(propertyName, true);
                return(true);
            }
            if (ChoETLFramework.IniFile != null && ChoETLFramework.IniFile.Contains(propertyName))
            {
                ChoETLFramework.WriteLog("'{0}' property discovered via application INI file.".FormatString(propertyName));
                _discoveredProperties.Add(propertyName, true);
                return(true);
            }
            else if (ChoAppSettings.Contains(propertyName))
            {
                ChoETLFramework.WriteLog("'{0}' property discovered via application config file.".FormatString(propertyName));
                _discoveredProperties.Add(propertyName, true);
                return(true);
            }

            ChoETLFramework.WriteLog("'{0}' property NOT found in any sources.".FormatString(propertyName));
            _discoveredProperties.Add(propertyName, false);
            return(false);
            //return cmdLineArgValue.IsNullOrWhiteSpace() ? ChoAppSettings.Contains(propertyName) : true;
        }
Example #2
0
        public static void SetConfigValue(string key, string value)
        {
            CheckInitCalled();

            if (IniFile != null && IniFile.Contains(key))
            {
                IniFile.SetValue(key, value);
            }
            else
            {
                ChoAppSettings.SetValue(key, value);
            }
        }
Example #3
0
        public static string GetConfigValue(string key, string defaultValue = null)
        {
            CheckInitCalled();

            if (IniFile != null && IniFile.Contains(key))
            {
                return(IniFile.GetValue(key, defaultValue, false));
            }
            else
            {
                return(ChoAppSettings.GetValue(key, defaultValue));
            }
        }