예제 #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());
     }
 }
예제 #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>());
            }
        }
예제 #3
0
 public static double GetAsDouble <T>(T nome)
 {
     return(Convert.ToDouble(ConfiguracaoAppUtil.Get(nome)));
 }
예제 #4
0
 public static List <decimal> GetAsListDecimal <T>(T nome, char separator = ',')
 {
     return(ConfiguracaoAppUtil.GetAsList(nome, separator).Select(t => Convert.ToDecimal(t.Trim())).ToList());
 }
예제 #5
0
 public static decimal GetAsDecimal <T>(T nome)
 {
     return(Convert.ToDecimal(ConfiguracaoAppUtil.Get(nome)));
 }
예제 #6
0
 public static List <int> GetAsListInt <T>(T nome, char separator = ',')
 {
     return(ConfiguracaoAppUtil.GetAsList(nome, separator).Select(t => Convert.ToInt32(t.Trim())).ToList());
 }
예제 #7
0
 public static int GetAsInt <T>(T nome)
 {
     return(Convert.ToInt32(ConfiguracaoAppUtil.Get(nome)));
 }
예제 #8
0
 public static List <DateTime> GetAsListDateTime <T>(T nome, char separator = ',')
 {
     return(ConfiguracaoAppUtil.GetAsList(nome, separator).Select(t => t.ToDateTime()).ToList());
 }
예제 #9
0
 public static DateTime GetAsDateTime <T>(T nome)
 {
     return(ConfiguracaoAppUtil.Get(nome).ToDateTime());
 }
예제 #10
0
 public static List <bool> GetAsListBool <T>(T nome, char separator = ',')
 {
     return(ConfiguracaoAppUtil.GetAsList(nome, separator).Select(t => Convert.ToBoolean(t.Trim())).ToList());
 }
예제 #11
0
 public static bool GetAsBool <T>(T nome)
 {
     return(Convert.ToBoolean(ConfiguracaoAppUtil.Get(nome)));
 }