Пример #1
0
        private static Func <object, object> CreateCastConverter(ConvertUtils.TypeConvertKey t)
        {
            MethodInfo method = t.TargetType.GetMethod("op_Implicit", new Type[1]
            {
                t.InitialType
            });

            if (method == null)
            {
                method = t.TargetType.GetMethod("op_Explicit", new Type[1]
                {
                    t.InitialType
                });
            }
            if (method == null)
            {
                return((Func <object, object>)null);
            }
            MethodCall <object, object> call = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall <object>((MethodBase)method);

            return((Func <object, object>)(o => call((object)null, new object[1]
            {
                o
            })));
        }
Пример #2
0
 public bool Equals(ConvertUtils.TypeConvertKey other)
 {
     if (this._initialType != other._initialType)
     {
         return(false);
     }
     return(this._targetType == other._targetType);
 }