Results 1 to 3 of 3

Thread: Classes and properties description

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2001
    Posts
    37

    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

  2. #2
    New Member
    Join Date
    Aug 2002
    Posts
    2
    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]

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    it should be

    <Description("your description here")>
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width