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)); }
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); }
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)); }
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)); }
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)); }
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); }
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); }
public static object GetPropertyValue(this object self, string propertyName, object[] index = null) { return(ReflectionUtil.GetReflectionType(self).GetPropertyInfo(propertyName).GetValue(self, index)); }
public static PropertyInfo GetPropertyInfo(this object self, string propertyName, BindingFlags bindingFlags = BindingFlagsConst.All) { return(ReflectionUtil.GetReflectionType(self).GetPropertyInfo(propertyName, bindingFlags)); }
public static object GetFieldValue(this object self, string fieldName, BindingFlags bindingFlags = BindingFlagsConst.All) { return(ReflectionUtil.GetReflectionType(self).GetFieldInfo(fieldName, bindingFlags).GetValue(self)); }
public static MethodInfo GetExtensionMethodInfo(this object self, string methodName, params Type[] sourceParameterTypes) { return(ReflectionUtil.GetReflectionType(self).GetExtensionMethodInfo(methodName, sourceParameterTypes)); }
public static MethodInfo GetExtensionMethodInfo2(this object self, string methodName) { return(ReflectionUtil.GetReflectionType(self).GetExtensionMethodInfo2(methodName)); }
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)); }
//////////////////////////Generic////////////////////////////// public static MethodInfo GetGenericMethodInfo2(this object self, string methodName, Type[] genericTypes, BindingFlags bindingFlags = BindingFlagsConst.All) { return(ReflectionUtil.GetReflectionType(self) .GetGenericMethodInfo2(methodName, genericTypes, bindingFlags)); }
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); }