Ejemplo n.º 1
0
        public static void SetMethodWithArg <T, U>(MethodInfo foundMember, T t, U value)
        {
            ParameterInfo[] paramInfo = foundMember.GetParameters();

            if (paramInfo.Length == 0)
            {
                foundMember.Invoke(t, new object[] { });
            }
            else
            {
                foundMember.Invoke(t, new object[] { CustomConvert.ChangeType(value, paramInfo[0].ParameterType) });
            }
        }
Ejemplo n.º 2
0
 public static void SetPropertyWithArg <T, U>(PropertyInfo foundMember, T t, U value)
 {
     foundMember.SetValue(t, CustomConvert.ChangeType(value, foundMember.PropertyType), null);
 }
Ejemplo n.º 3
0
 public static void SetFieldWithArg <T, U>(FieldInfo foundMember, T t, U value)
 {
     foundMember.SetValue(t, CustomConvert.ChangeType(value, foundMember.FieldType));
 }