Exemplo 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);
            }
        }
Exemplo 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);
            }
        }
Exemplo 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));
 }
Exemplo 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));
 }