How to assign an explanation to a function in c#  
Author Message
Kursat Konak





PostPosted: Visual C# IDE, How to assign an explanation to a function in c# Top

Hello,

I have functions in my library, but their explanation isn't enough to understand by only looking at their signatures. Meaning

Like whenever you go over a DataAdapter.Fill() Method with your mouse, it will explain to you what that function does in 2-3 lines. But when you go over my function with your mouse it only tells you the signature. I want to learn how to add information for my function for on mouse over tips.

DataAdapter.Fill() :

-------Data Adapter Signature Here---------------

Adds or refreshes rows in a System.Data.DataTable to match those in the data source using ......

MyFunction.DoSometing():

---------Function Signature Here--------------------

-No further explanation-




Visual C#12  
 
 
Mark Benningfield





PostPosted: Visual C# IDE, How to assign an explanation to a function in c# Top

Hello All.

Kursat Konak:

The IDE uses XML documentation comments to retrieve and display this information. The first thing you need to do is make sure that XML documentation comments are enabled. Do this by going to Project -> Tools -> Options in the IDE menu. Expand the Text Editor node, find the C# sub-node, and expand that. Under Advanced, make sure that the checkbox for Generate XML documentation comments for /// is checked.

Then, immediately preceding your method signature, type "///" , and a XML documentation summary tag will be generated, like this:

///<summary>
///
///</summary>

Type your descriptive text in between the opening and closing tags, and your description will appear in the Object Browser and in Intellisense.

HTH.



 
 
Kursat Konak





PostPosted: Visual C# IDE, How to assign an explanation to a function in c# Top

One more thing

how can i give explanation to function arguments. For example

f(string a, int b);

when i have to enter "a" value for the function i want intellisense to tell me that "a is the student name, max length is 30"and when i put a comma and ready to type "b" value i want it to tell me this is "student number"

In VS again DataAdapter.Fill() comman can be shown as example.

DataAdapter( ...... <- Tells you to insert DataSet name here

DataAdapter(DataSet11, ...... <- Tells you to insert Table name here)

thanks in advance



 
 
Kursat Konak





PostPosted: Visual C# IDE, How to assign an explanation to a function in c# Top

///<summary>Summary Here.</summary>

/// <param name="SQLquery">SQL Query Here.</param>

///<param name="SQLConnection">SQLCon Here</param>

This Works ^^