开发者

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 nee开发者_高级运维d 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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜