Example #1
0
 public static List <string> GetAsList <T>(T nome, char separator = ',')
 {
     if (String.IsNullOrEmpty(ConfiguracaoAppUtil.Get(nome)))
     {
         return(new List <string>());
     }
     else
     {
         return(ConfiguracaoAppUtil.Get(nome).Split(separator).Select(t => t.Trim()).ToList());
     }
 }
Example #2
0
        public static Dictionary <string, decimal> GetAsDictionaryDecimal <T>(T nome, char separator = ',', char separatorValue = '=')
        {
            var list = ConfiguracaoAppUtil.Get(nome).Split(separator);

            if ((list.Length > 0) && (list[0].Trim().Contains(separatorValue)))
            {
                return(list.ToDictionary <string, string, decimal>(t => t.Split(separatorValue)[0].Trim(), t => Convert.ToDecimal(t.Split(separatorValue)[1].Trim())));
            }
            else
            {
                return(new Dictionary <string, decimal>());
            }
        }
Example #3
0
 public static double GetAsDouble <T>(T nome)
 {
     return(Convert.ToDouble(ConfiguracaoAppUtil.Get(nome)));
 }
Example #4
0
 public static decimal GetAsDecimal <T>(T nome)
 {
     return(Convert.ToDecimal(ConfiguracaoAppUtil.Get(nome)));
 }
Example #5
0
 public static int GetAsInt <T>(T nome)
 {
     return(Convert.ToInt32(ConfiguracaoAppUtil.Get(nome)));
 }
Example #6
0
 public static DateTime GetAsDateTime <T>(T nome)
 {
     return(ConfiguracaoAppUtil.Get(nome).ToDateTime());
 }
Example #7
0
 public static bool GetAsBool <T>(T nome)
 {
     return(Convert.ToBoolean(ConfiguracaoAppUtil.Get(nome)));
 }