示例#1
0
        // Token: 0x06000013 RID: 19 RVA: 0x000023D4 File Offset: 0x000005D4
        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);

                var methodNames = methods.Select(p => p.Name).OrderBy(p => p);

                for (int i = 0; i < methods.Length; i++)
                {
                    MethodInfo methodInfo = methods[i];

                    if (this.IsMethodValid(methodInfo))
                    {
                        ParameterInfo[] parameters = methodInfo.GetParameters();

                        if (CallMethodAction.AreMethodParamsValid(parameters))
                        {
                            this.methodDescriptors.Add(new MethodDescriptor(methodInfo, parameters));
                        }
                    }
                }
                this.methodDescriptors = this.methodDescriptors.OrderByDescending(delegate(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();
            }
        }
示例#2
0
        // Token: 0x06000017 RID: 23 RVA: 0x00002530 File Offset: 0x00000730
        private static void OnTargetObjectChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            CallMethodAction callMethodAction = (CallMethodAction)sender;

            callMethodAction.UpdateMethodInfo();
        }