how to use the 'description' attribute in c#

K

KPK

Hello:

What namespace do I need to import in order to use the description
attribute in c#? I have class with custom properties and I would like
to have a description of the properties displayed on the property
page.

Here is the format I'm using:

[Description("User's Name")]
public string Name
{
get
{
return m_strName;
}
set
{
m_strName = value;
}
}

all it tells me is that type of namespace name cannot be found.

thanks.
 
J

Jon Skeet

KPK said:
What namespace do I need to import in order to use the description
attribute in c#?

System.ComponentModel.

The way to find this out in future is to look for the class name in
MSDN (DescriptionAttribute in this case) - that tells you the full name
of the class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top