473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How to add comments to my method parameters?

I have noticed that when I call certain methods, such as DataSet.ReadXml,
they have not only the parameter list but also a description of what needs to
be passed in. To use the example above, opening the brace tells you that the
first parameter expected is string fileName, and the description is

fileName: the filename(including the path) from which to read.

How can I add such descriptions when I create methods in my library of
classes? Descriptions for methods and classes are no problem, it's just the
parameter list I need.

Thank you in advance for your replies.
Apr 13 '06 #1
6 4275
just above the method type ///

"cashdeskmac" <ca*********@discussions.microsoft.com> wrote in message
news:F5**********************************@microsof t.com...
I have noticed that when I call certain methods, such as DataSet.ReadXml,
they have not only the parameter list but also a description of what needs
to
be passed in. To use the example above, opening the brace tells you that
the
first parameter expected is string fileName, and the description is

fileName: the filename(including the path) from which to read.

How can I add such descriptions when I create methods in my library of
classes? Descriptions for methods and classes are no problem, it's just
the
parameter list I need.

Thank you in advance for your replies.

Apr 13 '06 #2
Hi,

There are many XML comments you can use to document your methods, the
main ones being:

- <summary>
- <return>
- <param>
- <remarks>

For more info, see MSDN:
http://msdn.microsoft.com/library/de...onTutorial.asp

HTH,
Chris

Apr 14 '06 #3
Many thanks Chris, that was just what I was looking for.
Apr 14 '06 #4
Actuallu, it might not be.

I have added this code to a class:

/// <summary>
/// Read an xml file and return a DataSet containing all of the data
/// </summary>
/// <param name="path">The path to the XML file to read</param>
/// <returns>Returns a DataSet containing the tables listed in the
/// XML file</returns>
/// <remarks>Read an xml file and return a DataSet containing all of the
data</remarks>
public DataSet GetDataSetFromXml(string path)
{
ds = new DataSet();
ds.ReadXml(path);

return ds;
}

But when I call this method, Intellisense simply tells me that it takes a
string and has 1 overload.

I have rebuilt theclass library this class resides in, and updated the
reference to this dll, but still get no more information than the default.

Apr 14 '06 #5
Check that your XML documentation file is in the same directory as the
compiled assembly, and that it has the same name as the assembly, but
with a .xml extension.

Apr 14 '06 #6
That did it! Thanks again, chris

"Chris Fulstow" wrote:
Check that your XML documentation file is in the same directory as the
compiled assembly, and that it has the same name as the assembly, but
with a .xml extension.

Apr 15 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lawrence | last post by:
I've been bad about documentation so far but I'm going to try to be better. I've mostly worked alone so I'm the only one, so far, who's suffered from my bad habits. But I'd like other programmers...
2
by: Mad Scientist Jr | last post by:
Is it possible to write a method with a signature for x parameters (so you get intellisense when you call it), but from within the method, be able to access the parameter names and values in a...
5
by: news.bellatlantic.net | last post by:
I added these comments "///" (below is an example) to help the developers use the classes and methods I am adding the library. When I instantiate an object in the same project I get help from the...
9
by: Eric S. | last post by:
Why doesn't something like this work? I get "a constant value is expected" on all 3 case statements. private DataGrid CurrentDataGrid(DataGrid firstDg, DataGrid secondDg) { try { switch...
6
by: Clive Dixon | last post by:
It's a bit of a PITA to duplicate XML comments in such a scenario as where you want to give a class method implementing an interface method exactly the same documentation (or part thereof) as the...
1
by: kplkumar | last post by:
I am trying to get the method and the parameters passed to that method from the stackTrace. My code is, private void GetExecutingMethodInfo() { StackTrace trace = new StackTrace(false); ...
3
by: bim_bom | last post by:
I have a projet in C++ Builder. I want to add aome lines of comment before each function of the project. This should work like that: I have function: int r(int a,char b) { } this program...
98
by: tjb | last post by:
I often see code like this: /// <summary> /// Removes a node. /// </summary> /// <param name="node">The node to remove.</param> public void RemoveNode(Node node) { <...> }
3
by: Sagar | last post by:
Hi. I am working on a project to migrate a web application from 1.1 to 2.0 Within in the DAL of the application, there is a call to below function that builds a command object for later use. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.