|
-
Aug 9th, 2002, 03:45 PM
#1
Thread Starter
Member
Classes and properties description
Hi.
I am trying to document my classes and their properties and methods by using attributes. These classes are inside the main project, they won't be compiled separately. I have seen some examples of using a <Description> attribute to give a description for a class or method, but it does not display by default in the intellisense. I found an example where there is an Imports for System.ComponentModel but I think it is for external components or usercontrols because, the descriptions I set won't display in the Object Browser. What is the necessary reference I should make in order to describe a class and its methods, when this class is inside an exe project?
Thanks
-
Aug 13th, 2002, 02:41 PM
#2
New Member
In VB6 you have to put special attributes in the .cls file to do this. not sure if .net does the same thing.
for example: (from .cls file for vb6)
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "mClass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Description = "THis is the description, this will appear in the object browser."
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit
'local variable(s) to hold property value(s)
Private mvarmProperty As Variant 'local copy
Public Property Let mProperty(ByVal vData As Variant)
Attribute mProperty.VB_Description = "Another Jeff Description of the property"
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.mProperty = 5
mvarmProperty = vData
End Property
Public Property Set mProperty(ByVal vData As Variant)
'used when assigning an Object to the property, on the left side of a Set statement.
'Syntax: Set x.mProperty = Form1
Set mvarmProperty = vData
End Property
Public Property Get mProperty() As Variant
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.mProperty
If IsObject(mvarmProperty) Then
Set mProperty = mvarmProperty
Else
mProperty = mvarmProperty
End If
End Property[B][COLOR=darkblue][SIZE=3][FONT=arial][COLOR=red]
-
Aug 14th, 2002, 08:24 AM
#3
it should be
<Description("your description here")>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|