add new issue       

Issue ID:  180     Change RegisterProperty() to pick up metadata from attributes and PropertyDescriptor      
Created by rocky on 2008-09-24 10:41 AM, 3344 days ago
Project:  CSLA .NET
Category:  enhancement
Priority:  med
Status:  closed
Feature area:Base classes
Version:Future
  Entering "issue#999" in comment creates link to id 999

show inline images      show change history

comment 2293 posted by blaken on 2010-03-16 1:36 PM, 2806 days ago 
Updated RegisterProperty() to pick up metadata from ComonentModel and DynamicData Attributes. Added Unit tests for these changes. Added some method overrides to the PropertyInfo class and added some documentation (Made it easier to specify the default value). Added a private constructor to PropertyInfo.
comment 1815 posted by rocky on 2009-10-27 10:53 AM, 2946 days ago 
merged bug 132 into this bug:
Allow use of a delegate/lambda to get property friendly name dynamically
comment 1811 posted by rocky on 2009-10-27 10:52 AM, 2946 days ago 
merged bug 317 into this bug:
Consider an attribute-based approach as an alternative to RegisterProperty()
comment 1809 posted by rocky on 2009-10-27 10:48 AM, 2946 days ago 

This can probably tie into the DataAnnotations attributes for some metadata.

comment 1165 posted by rocky on 2009-03-17 8:00 PM, 3170 days ago 

Linked to issue#317

comment 1164 posted by rocky on 2009-03-17 8:00 PM, 3170 days ago 
Linked to issue#180
comment 1163 posted by rocky on 2009-03-17 7:58 PM, 3170 days ago 

Even without a wholesale replacement of the RegisterProperty() mechanism, it would be useful if the lambda overloads (or maybe all overloads?) checked for a DisplayName attribute on the property and used that as a friendly name.

Similarly, DefaultValue and RelationshipType attributes could be added and read by PropertyInfo<T> as well, allowing everything to be attribute based except the RegisterProperty() call itself. Perhaps a very nice compromise.

comment 993 posted by rocky on 2009-01-27 9:43 PM, 3219 days ago 
http://forums.lhotka.net/forums/thread/30378.aspx
comment 512 posted by rocky on 2008-09-26 12:01 PM, 3342 days ago 
affected by issue#180
comment 511 posted by rocky on 2008-09-26 12:01 PM, 3342 days ago 
affected by issue#132
comment 509 posted by rocky on 2008-09-26 11:59 AM, 3342 days ago 
The way to do this is probably to have PropertyInfo<T> grab the DisplayName attribute value from the property definition if a friendly name is not explicitly provided via the ctor.
comment 486 posted by rocky on 2008-09-24 10:41 AM, 3344 days ago 
http://forums.lhotka.net/forums/thread/22599.aspx
comment 373 posted by rocky on 2008-09-16 8:18 AM, 3352 days ago 
When code is running on a shared server, and multiple cultures are required, the current model of storing the property friendly name as a static value is problematic. There's no way to make that value dynamic so it is different per culture.

It may be possible for the business object to provide the PropertyInfo<T> object with a lambda (or maybe a delegate) that gets the property friendly name from a resource file or other source. This could allow for a business object author to provide different values for different cultures.