XML Comments and ComponentModel.Description attribute

C

CMM

In VS2005 / VB.NET, do you still have to spell out the
ComponentModel.Description attribute when you want properties of a custom
control to have description text in the Property Editor?... or can you use
XML Comments take the place of this? If you still need to specify both, why
can't the XML Comments shortcut (''') automatically pick up the
ComponentModel.Description already defined for the Property....

With the VBCommenter power toy add-in in VS2003 you could type ''' and the
XML Comments would automatically be filled in with the value of
ComponentModel.Description attribute already specified for the property.

If so, this yet another "little thing" where VS2005 is completely
half-assed. I swear the more I use this thing the more I'm infuriated by its
total brainlessness. I hope I'm wrong. I really hope I'm wrong.
 
H

Herfried K. Wagner [MVP]

CMM said:
In VS2005 / VB.NET, do you still have to spell out the
ComponentModel.Description attribute when you want properties of a custom
control to have description text in the Property Editor?... or can you use
XML Comments take the place of this?

You have to specify both, but importing the 'System.ComponentModel'
namespace will make your code more readable:

\\\
Imports System.ComponentModel ' Alternatively use a project-wide import.
....
<Description("...")> _
Public Property...
///
 
C

CMM

I can't believe the VBCommenter power toy add-in in VS2003 is better than
the functionality in the super-hyped up VS2005! That says a lot.
Anyway... I came up with a very nice time-saver by creating a code snippet
for it and assigning it a "cmprop + tab" as a shortcut key (using the VB
Code Snipper Editor...
http://msdn.microsoft.com/vbasic/downloads/tools/snippeteditor/).
''' <summary>
''' $description$
''' </summary>
<ComponentModel.Description("$description$")> _
 

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