예제 #1
0
 public static T InvokeExtension <T>(object obj, string methodName, bool isMissNotInvoke = true,
                                     params object[] parameters)
 {
     return(InvokeExtension <T>(obj, ReflectionUtil.GetReflectionType(obj).FullName, methodName,
                                isMissNotInvoke,
                                parameters));
 }
예제 #2
0
 public static void InvokeExtensionGeneric(object obj, string methodName, Type[] genericTypes,
                                           bool isMissNotInvoke = true,
                                           params object[] parameters)
 {
     InvokeExtensionGeneric(obj, ReflectionUtil.GetReflectionType(obj).FullName, methodName, genericTypes,
                            isMissNotInvoke,
                            ReflectionUtil.GetReflectionType(obj).Assembly.FullName, parameters);
 }
예제 #3
0
 public static T InvokeGeneric <T>(object obj, string methodName, Type[] genericTypes,
                                   bool isMissNotInvoke = true,
                                   params object[] parameters)
 {
     return(InvokeGeneric <T>(obj, ReflectionUtil.GetReflectionType(obj).FullName, methodName, genericTypes,
                              isMissNotInvoke,
                              parameters));
 }
예제 #4
0
        public static T Invoke <T>(object obj, string fullClassPath, string methodInfoString,
                                   bool isMissNotInvoke = true, params object[] parameters)
        {
            MethodInfo methodInfo = GetMethodInfo(fullClassPath, methodInfoString,
                                                  GetReflectionObject(obj) == null ? BindingFlagsConst.Static : BindingFlagsConst.Instance, null,
                                                  ReflectionUtil.GetReflectionType(obj).Assembly, parameters);

            return(methodInfo == null && isMissNotInvoke ? default(T) : Invoke <T>(obj, methodInfo, parameters));
        }
예제 #5
0
        public static T InvokeExtension <T>(object obj, string fullClassPath, string methodInfoString,
                                            bool isMissNotInvoke = true, params object[] parameters)
        {
            parameters = parameters.ToList().AddFirst(obj).ToArray();
            MethodInfo methodInfo = GetExtensionMethodInfo(fullClassPath, methodInfoString,
                                                           ReflectionUtil.GetReflectionType(obj).Assembly, parameters);

            return(methodInfo == null && isMissNotInvoke
                                ? default(T)
                                : ReflectionUtil.Invoke <T>(obj, methodInfo, parameters));
        }
예제 #6
0
        public static void InvokeExtension(object obj, string fullClassPath, string methodInfoString,
                                           bool isMissNotInvoke = true, params object[] parameters)
        {
            parameters = parameters.ToList().AddFirst(obj).ToArray();
            MethodInfo methodInfo = GetExtensionMethodInfo(fullClassPath, methodInfoString,
                                                           ReflectionUtil.GetReflectionType(obj).Assembly.FullName, parameters);

            if (methodInfo == null && isMissNotInvoke)
            {
                return;
            }
            ReflectionUtil.Invoke <object>(obj, methodInfo, parameters);
        }
예제 #7
0
        public static void Invoke(object obj, string fullClassPath, string methodInfoString,
                                  bool isMissNotInvoke = true, params object[] parameters)
        {
            MethodInfo methodInfo = GetMethodInfo(fullClassPath, methodInfoString,
                                                  GetReflectionObject(obj) == null ? BindingFlagsConst.Static : BindingFlagsConst.Instance, null,
                                                  ReflectionUtil.GetReflectionType(obj).Assembly.FullName, parameters);

            if (methodInfo == null && isMissNotInvoke)
            {
                return;
            }
            Invoke <object>(obj, methodInfo, parameters);
        }
예제 #8
0
 public static object GetPropertyValue(this object self, string propertyName, object[] index = null)
 {
     return(ReflectionUtil.GetReflectionType(self).GetPropertyInfo(propertyName).GetValue(self, index));
 }
예제 #9
0
 public static PropertyInfo GetPropertyInfo(this object self, string propertyName,
                                            BindingFlags bindingFlags = BindingFlagsConst.All)
 {
     return(ReflectionUtil.GetReflectionType(self).GetPropertyInfo(propertyName, bindingFlags));
 }
예제 #10
0
 public static object GetFieldValue(this object self, string fieldName,
                                    BindingFlags bindingFlags = BindingFlagsConst.All)
 {
     return(ReflectionUtil.GetReflectionType(self).GetFieldInfo(fieldName, bindingFlags).GetValue(self));
 }
예제 #11
0
 public static MethodInfo GetExtensionMethodInfo(this object self, string methodName,
                                                 params Type[] sourceParameterTypes)
 {
     return(ReflectionUtil.GetReflectionType(self).GetExtensionMethodInfo(methodName, sourceParameterTypes));
 }
예제 #12
0
 public static MethodInfo GetExtensionMethodInfo2(this object self, string methodName)
 {
     return(ReflectionUtil.GetReflectionType(self).GetExtensionMethodInfo2(methodName));
 }
예제 #13
0
 public static MethodInfo GetGenericMethodInfo(this object self, string methodName, Type[] genericTypes,
                                               BindingFlags bindingFlags = BindingFlagsConst.All, params Type[] sourceParameterTypes)
 {
     return(ReflectionUtil.GetReflectionType(self)
            .GetGenericMethodInfo(methodName, genericTypes, bindingFlags, sourceParameterTypes));
 }
예제 #14
0
 //////////////////////////Generic//////////////////////////////
 public static MethodInfo GetGenericMethodInfo2(this object self, string methodName, Type[] genericTypes,
                                                BindingFlags bindingFlags = BindingFlagsConst.All)
 {
     return(ReflectionUtil.GetReflectionType(self)
            .GetGenericMethodInfo2(methodName, genericTypes, bindingFlags));
 }
예제 #15
0
 public static void Invoke(object obj, string methodName, bool isMissNotInvoke = true,
                           params object[] parameters)
 {
     Invoke(obj, ReflectionUtil.GetReflectionType(obj).FullName, methodName, isMissNotInvoke,
            ReflectionUtil.GetReflectionType(obj).Assembly.FullName, parameters);
 }