public ObjectConfigure GetConfigure() { if (_configure != null) { return(_configure); } if (Type != typeof(ObjectConfigure)) { throw new Exception($"Return type is not {nameof(ObjectConfigure)}"); } if (MemberType == MemberTypes.Method) { _configure = (ObjectConfigure)((MethodInfo)Member).Invoke(_Instance, null); } else { if (MemberType == MemberTypes.Field) { _configure = (ObjectConfigure)((FieldInfo)Member).GetValue(_Instance); } else { _configure = (ObjectConfigure)((PropertyInfo)Member).GetValue(_Instance); } } return(_configure); }
public static IBindingExpression CreateObjectBinding(PropertyInfo propertyInfo, ObjectConfigure configure) { if (!IsEnumerable(propertyInfo.PropertyType)) { return(new ObjectBindingExpression(propertyInfo, configure)); } else { return(new ObjectArrayBindingExpression(propertyInfo, configure)); } }
public ObjectBindingExpression(PropertyInfo propertyInfo, ObjectConfigure configure) : base(propertyInfo) { Configure = configure; }