Class properties

  • Thread starter Thread starter Rob T
  • Start date Start date
R

Rob T

OK....trivial question, but would be nice to have....:

Let's say I have simple class like this:

Public Class EMailer
Public [To] As String ' The Internet address of the recipient
Public From As String ' The Internet address of the sender

Public Function Send() As String
'sends the message
Return [To] & "-" & From
End Function
End Class

Now in the main code when I'm typing in my code like this:

dim mail as new EMailer
mail.to="Rob"

When I'm typing and get to the "." the visual designer shows me what objects
are available. How do you create the class so that the little descriptions
show up when you hover over each object?

-Rob T.
 
There are 3rd party utilities that allow you to do this in VB.Net but no way to
do it w/o them. C# uses the code comments for intellisense descriptions and
VB.Net has not been brought up to speed with them.

One of the many advantages of C# over VB.Net. But still, not enough for most
people that use VB.Net to convert.

Bah!

Mythran
 
Thanks.... I guess I'll have to suffer with non-descriptive classes!


Mythran said:
There are 3rd party utilities that allow you to do this in VB.Net but no way to
do it w/o them. C# uses the code comments for intellisense descriptions and
VB.Net has not been brought up to speed with them.

One of the many advantages of C# over VB.Net. But still, not enough for most
people that use VB.Net to convert.

Bah!

Mythran

Rob T said:
OK....trivial question, but would be nice to have....:

Let's say I have simple class like this:

Public Class EMailer
Public [To] As String ' The Internet address of the recipient
Public From As String ' The Internet address of the sender

Public Function Send() As String
'sends the message
Return [To] & "-" & From
End Function
End Class

Now in the main code when I'm typing in my code like this:

dim mail as new EMailer
mail.to="Rob"

When I'm typing and get to the "." the visual designer shows me what objects
are available. How do you create the class so that the little descriptions
show up when you hover over each object?

-Rob T.
 
* "Rob T said:
Let's say I have simple class like this:

Public Class EMailer
Public [To] As String ' The Internet address of the recipient
Public From As String ' The Internet address of the sender

I would use properties in this situation.
dim mail as new EMailer
mail.to="Rob"

When I'm typing and get to the "." the visual designer shows me what objects
are available. How do you create the class so that the little descriptions
show up when you hover over each object?

My FAQ:

Adding tooltips in intellisense for VB.NET assemblies:

VS.NET takes the text shown in intellisense tips from an XML file that
is provided in addition to the assembly (for example, a DLL). The XML
file must have the same name as the corresponding DLL with ".xml"
appended and must be placed in the same folder as the assembly
(assembly "Foo.dll", XML file "Foo.dll.xml").

The format of the XML file taken by VS.NET is specified here:

<URL:http://msdn.microsoft.com/library/en-us/csref/html/vclrfprocessingxmlfile.asp>

For C#, VS.NET creates this XML file automatically (compiler option
"/doc"). For VB.NET, that's currently not supported, but this will be
possible in VB 2005.

You can create the XML file by hand, but notice that this will take a
lot of time and it will be hard to update the file if parts of the
assembly change. It's much easier to use one of the tools listed below
to create the XML file. Tools like NDOC will take the XML file and can
be used to create an HTML Help file from this data.

One easy way is to provide information for tooltips as XML comments
inside the source files and then use tools like VB.DOC to create the XML
file that contains the data. Then you can copy this file into the
assembly's directory to provide information to VS.NET that enables it to
display tooltips, or you can create a help file. The help file can be
deployed with the assembly and can be used by other developers who use
the assembly as reference.

For VB.NET 2002/2003:

My XML Comments FAQ:

VB Commenter
<URL:http://www.gotdotnet.com/team/ide/>
-> "VB Commenter"

XML Documentation
<URL:http://www.gotdotnet.com/team/vb/>
-> "XML Documentation"

VBXC - VB.NET XML Commentor
<URL:http://vbxmldoc.tor-erik.net/>

NDOC (formerly DOC.NET)
<URL:http://ndoc.sourceforge.net/>

VB.DOC
<URL:http://vb-doc.sourceforge.net/>

<URL:http://www.gotdotnet.com/Community/Workspaces/Workspace.aspx?id=112b5449-f702-46e2-87fa-86bdf39a17dd>

XML comments will be introduced to VB in version 2005 ("Whidbey").

C# XML comments:

C# Programmer's Reference -- Recommended Tags for Documentation Comments
<URL:http://msdn.microsoft.com/library/en-us/csref/html/vclrfTagsForDocumentationComments.asp>
 
Back
Top