Example #1
0
 private void UpdateMethodInfo()
 {
     this.methodDescriptors.Clear();
     if (this.Target != null && !string.IsNullOrEmpty(this.MethodName))
     {
         Type         type    = this.Target.GetType();
         MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Public);
         for (int i = 0; i < methods.Length; i++)
         {
             MethodInfo methodInfo = methods[i];
             if (this.IsMethodValid(methodInfo))
             {
                 ParameterInfo[] parameters = methodInfo.GetParameters();
                 if (CallParameterizedMethodAction.AreMethodParamsValid(parameters))
                 {
                     this.methodDescriptors.Add(new CallParameterizedMethodAction.MethodDescriptor(methodInfo, parameters));
                 }
             }
         }
         //this.methodDescriptors = this.methodDescriptors.OrderByDescending(delegate(CallParameterizedMethodAction.MethodDescriptor methodDescriptor)
         //{
         //    int num = 0;
         //    if (methodDescriptor.HasParameters)
         //    {
         //        Type type2 = methodDescriptor.SecondParameterType;
         //        while (type2 != typeof(EventArgs))
         //        {
         //            num++;
         //            type2 = type2.BaseType;
         //        }
         //    }
         //    return methodDescriptor.ParameterCount + num;
         //}).ToList<CallParameterizedMethodAction.MethodDescriptor>();
     }
 }