NDOC: How to make good use of Your XML Comments?
Writen by Allen Lee
Requirement
Use C # to develop the library. Use XML annotations in the source code. Tired of additional documentation work, I hope there is no regretful computer to pick up this boring job. With C # development conditions, at least the .NET Framework SDK 1.1 is required. Can try to suppress your sleepy insects, do not let it hinder you to read this article. other...
ENCOUNTERED Problems
The popularity of object-oriented technology has brought us great convenience. The reuse of the object reduces many unnecessary pain when we coded, clear code responsibility separation system is avoided in addition to our aversion to "Italian Powder". However, we still have to face the boring document - from the content conception to the page version. I believe that the library developers have experienced this disgusted, even if we all recognize the importance of documents. Of course, some big companies have a dedicated write document, but the most understanding of the library is the programmer! The programmer often adds a comment for the code in the library developed. If there is a tool to take advantage of these comments, you can directly export the document directly in a certain format! Smart and "lazy" programmers are always one step more than others. They don't want to put themselves in the repeated and boring box. These boring throwing a computer that has no regrets.
Feel Free To Write your class library with xml comments address
Simple text can't make you appreciate the charm of NDOC, at least I haven't had this ability. are you asleep? (Perhaps Zhou Gong's story is more interesting!) Over, please see the following demonstration code - a class representing a plural (Class).
Using
System; using
System.globalization; Namespace
Mathutils
{/ ** ////
If you have a Visual C # .NET, then you can use the steps: Right-click the item icon in the Solution Manager, select Properties | Configuration Properties | Generate, in [Output] [XML Document File] The file name of the target XML file is filled in the right, here is Complex.xml. Save Setup and turn off the dialog box, generate the project, you will find this XML file in the root of the project. No Visual C # .NET? Not called, using the C # command line compiler CSC.exe. You can generate an XML annotation file if you need to type CSC Complex.cs /Doc:Complex.xml
XML Version = "1.0" encoding = "UTF-8"?>
askMBLY>
Provide multiple related operations services.
summary>
member>
The default constructor sets the complex real part to 0;
summary>
member>
param>
member>
Convert the plural to the corresponding string.
summary>
Returns a string in the form of (x) (Y) i.
returns>
member>
Multiple real part.
summary>
member>
Multiple ingredients.
summary>
member>
members>
doc>
WHERE ISUR protagonist?
It is time to come to the protagonist of this play - DOC. Next ... Download ... Installation ... Start NDOC ... (whether man can not get rid of boring odor?) Press [Add] to add your DLL or EXE, and XML annotation file associated with it. .
What kind of format do you want NDOC to generate a library document? Hey, there are a lot of types available! Let's try MSDN! Ok, all the best, only ungenerate. Now build it!
Well Done! This is our second phase of results, that is, the final result! Do you feel that itch is ready to try it?
Conclusion
Finally, the finals, one hundred people have one hundred Hamlet, I don't know how NDOC is in your mind? I don't know if you think that NDOC is eccentric, only C # that can use XML Comments is so good. However, VB.NET does not need to be sad, because you have a vbcommenter to support you silently!