Page 1 of 1

Adding Documentation & Summaries to your code. Rate Topic: ***** 1 Votes

#1 AdamSpeight2008   User is offline

  • MrCupOfT
  • member icon

Reputation: 2298
  • View blog
  • Posts: 9,535
  • Joined: 29-May 08

Posted 10 September 2008 - 06:37 PM

Seeing that C# as a tutorial on Code Documentation.
:->:JacobJordan's C# Adding Documentation & Summaries to your code Tutorial
I show you how to do the same in VB.Net.

Adding Documentation
As you been typing away you may have notice the handy pop up message that appear giving you more information about the method you are using.
Example
http://www.dreamincode.net/forums/index.php?act=Attach&type=post&id=8284

Let's imagine we want document the following function.
   Public Function Multiply(ByVal X As Double, ByVal Y As Double) As Double
        Return X * Y
    End Function



Within your class and just out the routine you want to add documentation for.
Type: '''
And Visual Studio will insert the correct tags for you.
    ''' <summary>
    ''' A description of what the function does.
    ''' </summary>
    ''' <param name="X">Description of the first parameter</param>
    ''' <param name="Y">Description of the second parameter</param>
    ''' <returns>Description for what the function returns</returns>
    ''' <remarks>Text put here will not display in a Visual Studio summary box.  
''' It is meant to add in further detail for anyone who might read this  
''' code in the future </remarks>
    Public Function Multiply(ByVal X As Double, ByVal Y As Double) As Double
        Return X * Y
    End Function


OK now you can document you code.

"What about the GUI Designer?", I heard you ask.

Property Grid Tags
So you've created a custom control.
Add the following the each of the property want to appear in the Properties window.
< _
System.ComponentModel.Category("My Controls Properties") , _
System.ComponentModel.DisplayName("Property Name") , _
System.ComponentModel.Description("Changes the background color of clock") , _
System.ComponentModel.DefaultValue(0)
>



System.ComponentModel.Category("My Controls Properties")
This places the property under the category My Controls Properties inside properties window of the Form Designer.
System.ComponentModel.DisplayName("Property Namer")
This is the displayed name of the property.
System.ComponentModel.Description("Changes the background color of clock")
This is the textual description of what the property does.
System.ComponentModel.DefaultValue(0)
This is the default value.

Now you're one step closes to being a Code-Documenting Ninja :ph34r:
Attachments
Attached Image

Is This A Good Question/Topic? 1
  • +

Page 1 of 1