Esempio n. 1
0
        public static bool TryRepeatAs <TObj>(this ILeoVisitor visitor, IDictionary <string, object> keyValueCollections, out TObj result)
        {
            result = default;
            var ret = visitor.TryRepeat(keyValueCollections, out var val);

            if (!ret)
            {
                return(false);
            }

            try
            {
                result = (TObj)val;
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Esempio n. 2
0
        public static bool TryRepeatAs <TObj>(this ILeoVisitor visitor, object instance, out TObj result)
        {
            result = default;
            var ret = visitor.TryRepeat(instance, out var val);

            if (!ret)
            {
                return(false);
            }

            try
            {
                result = (TObj)val;
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Esempio n. 3
0
 public static bool TryRepeatAs <T>(this ILeoVisitor <T> visitor, IDictionary <string, object> keyValueCollections, out T result)
 {
     result = default;
     return(visitor.TryRepeat(keyValueCollections, out result));
 }
Esempio n. 4
0
 public static bool TryRepeatAs <T>(this ILeoVisitor <T> visitor, T instance, out T result)
 {
     result = default;
     return(visitor.TryRepeat(instance, out result));
 }