Changing the DescriptionAttribute value

  • Thread starter Thread starter Mario Vázquez
  • Start date Start date
M

Mario Vázquez

How can I change the value of the DescriptionAttribute depending on the
CultureInfo context?

[ Description( "Description for the property at design-time") ]
public object TestProperty
{
get{ return this.testProperty; }
set{ this.testProperty = value; } string testProperty;
}

I've try to change the string in the attribute accessing an item from a
resource file, but attribute values only accept constant values.

Thanks,
Mario Vazquez
 
subclass the DescriptionAttribute class whose constructor parameter you
will pass the resource key. Override the Description property to
return the string obtained from the resource file.

OT: are you the idol singer last year? :p
 
Back
Top