public PropertieDefinition(Type type, PropertyInfo propertyInfo)
 {
     Name            = propertyInfo.Name;
     Type            = propertyInfo.PropertyType;
     _getter         = ObjectAccessors.CreatePropertyGetter(type, propertyInfo.Name);
     _propertySetter = ObjectAccessors.CreatePropertySetter(type, propertyInfo.Name);
 }
 public PropertieDefinition(Type type, FieldInfo fieldInfo)
 {
     Name            = fieldInfo.Name;
     Type            = fieldInfo.FieldType;
     _getter         = ObjectAccessors.CreatePropertyGetter(type, fieldInfo.Name);
     _propertySetter = ObjectAccessors.CreatePropertySetter(type, fieldInfo.Name);
 }
        ObjectAccessors.PropertySetter CreateSetter(Type type, string name)
        {
            if (IsWritable)
            {
                return(ObjectAccessors.CreatePropertySetter(type, name));
            }

            var result = TypeDefinition.MethodAddToCollection != null ? new ObjectAccessors.PropertySetter(TypeDefinition.MethodAddToCollection) : null;

            return(result);
        }