Esempio n. 1
0
 public static JcfResult <string> GetString(this Jcf source, string key)
 {
     try
     {
         return((source[key] is string str) ? (JcfResult <string>)str :
                (JcfResult <string>)ResultOptions.TypeWrong);
     }
     catch (ArgumentException ae)
     {
         return((JcfResult <string>)ae);
     }
 }
Esempio n. 2
0
 public static JcfResult <List <Jcf> > GetList(this Jcf source, string key)
 {
     try
     {
         return((source[key] is List <Jcf> jcf) ? (JcfResult <List <Jcf> >)jcf :
                (JcfResult <List <Jcf> >)ResultOptions.TypeWrong);
     }
     catch (ArgumentException ae)
     {
         return((JcfResult <List <Jcf> >)ae);
     }
 }
Esempio n. 3
0
        public static JcfResult <JcfEnumerable> GetMappedList(this Jcf source,
                                                              string key, string innerkey)
        {
            JcfResult <List <Jcf> > lst = source.GetList(key);

            if (lst)
            {
                return((JcfResult <JcfEnumerable>)(new JcfEnumerable(lst.value, innerkey)));
            }
            else
            {
                return(lst.CrossCast <JcfEnumerable>());
            }
        }