/// <summary> /// Creates a dynamic PropertyEditor assignment based on the specified static <see cref="PropertyEditorMatching"/> method. /// </summary> /// <param name="methodHostType"></param> /// <param name="staticMethodName"></param> public PropertyEditorAssignmentAttribute(Type methodHostType, string staticMethodName) { TypeInfo hostTypeInfo = methodHostType.GetTypeInfo(); MethodInfo methodInfo = hostTypeInfo.GetRuntimeMethods().FirstOrDefault(m => m.IsStatic && m.Name == staticMethodName); this.dynamicAssign = Delegate.CreateDelegate(typeof(PropertyEditorMatching), methodInfo) as PropertyEditorMatching; }
/// <summary> /// Creates a dynamic PropertyEditor assignment based on the specified static <see cref="PropertyEditorMatching"/> method. /// </summary> /// <param name="methodHostType"></param> /// <param name="staticMethodName"></param> public PropertyEditorAssignmentAttribute(Type methodHostType, string staticMethodName) { MethodInfo methodInfo = methodHostType.GetMethod(staticMethodName, ReflectionHelper.BindStaticAll); this.dynamicAssign = Delegate.CreateDelegate(typeof(PropertyEditorMatching), methodInfo) as PropertyEditorMatching; }