コード例 #1
0
        public static T ReadEnvironmentVariable <T>(string key)
        {
            if (String.IsNullOrWhiteSpace(key))
            {
                return(default(T));
            }
            key = key.ToUpper();
            SetupDefaults();

            T defaultValue = default(T);

            if (_lstDefaults.ContainsKey(key))
            {
                try
                {
                    defaultValue = (T)Convert.ChangeType(_lstDefaults[key].ToString(), typeof(T));
                }
                catch
                {
                    //ignore
                }
            }
            return(XmlWrapper.ReadVariable <T>(Globals.ApplicationEnvironmentVariables, key, defaultValue));
        }
コード例 #2
0
 public static List <string> ReadEnvironmentVariables(string key)
 {
     return(XmlWrapper.ReadVariable(Globals.ApplicationEnvironmentVariables, key));
 }