Beispiel #1
0
        private static MethodInfo GetMethodInfo(Type objectType, InvokeMethodParameter param)
        {
            MethodInfo info = null;

            for (Type type = objectType; (type != null) && (info == null); type = type.BaseType)
            {
                info = GetMethodInfo_(type, param);
            }
            return(info);
        }
Beispiel #2
0
 private static MethodInfo GetMethodInfo_(Type objectType, InvokeMethodParameter param)
 {
     return(objectType.GetMethod(param.Name, param.Flags, null, param.Types, new ParameterModifier[0]));
 }
Beispiel #3
0
 public static bool IsMethodExist(Type type, InvokeMethodParameter param)
 {
     return(GetMethodInfo(type, param) != null);
 }
Beispiel #4
0
 public bool IsMethodExist(InvokeMethodParameter param)
 {
     return(IsMethodExist(this._objectType, param));
 }
Beispiel #5
0
 public static object InvokeStaticMethod(Type type, InvokeMethodParameter param)
 {
     return(GetMethodInfo(type, param).Invoke(null, param.Parameters));
 }
Beispiel #6
0
 public object InvokeMethod(InvokeMethodParameter param)
 {
     return(GetMethodInfo(this._objectType, param).Invoke(this._object, param.Parameters));
 }