简体   繁体   中英

How to add description to a user control property in vb.net

I created one web user control with property named "ReadonlyField" with boolean datatype. I am able to use in my web pages and now I wanted to add a description to that property so that I don't need to explain each time to my team member what is that property's intention.

I got following snippet in c# but didnt find any equivalent in vb.net and also not sure whether it will work or not.

[Description("My Description")]
public int MyIntProperty
{
    get {..}
    set {..}
}

A literal translation in VB 10

<Description("My Description")> Public Property MyIntProperty As Integer

If this is for other programmers you may want to offer Intellisense support via XML comments. This is the standard way of doing it in both VB and C#.

VB

 ''' <summary>
 ''' Description goes here
 ''' </summary>
 ''' <value></value>
 ''' <returns></returns>
 ''' <remarks></remarks>
 Public Property MyIntProperty As Integer

Actually, I put mine into the summary block, and then it shows in Intellisense...

 ''' <summary>
 ''' Returns "INSTALLATION ACTION INITIATED"
 ''' </summary>
 ''' <value></value>
 ''' <returns></returns>
 ''' <remarks></remarks>
 Public ReadOnly Property IAS
     Get
         Return _dict("IAS")
     End Get
 End Property

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM