C# How to Program43_2

C# How to Program43_2 - csphtp1.book Page 1346 Wednesday...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1346 Generating Documentation in Visual Studio Appendix E Notice that only class members are included in the generated XML file. Each class member has a member element which includes all XML comments for that member. For example, lines 50–69 define a member element that contains information on the two-argu- ment Point constructor. The name attribute of a member tag is a string that contains information about the name and type of the member. The type is specified by a capital letter: M stands for method, P for property (or indexer), E for event and T for type (i.e, class). For a complete listing of these abbreviations, select Help > Index , then locate the topic processing XML files in C# . In Fig. E.8, line 51 contains the value of the name attribute and contains an M as the first letter, indicating that line 51 declares a method (recall that a constructor is a specialized method). A colon follows, after which the full name of the method is shown. For this example, it is Cir- cleTest.Point.#ctor(System.Int32,System.Int32) . Because this is a constructor, the string #ctor is used in the fully qualified name. This constructor takes two int arguments—the parentheses after the name of each member specify that member’s type. TERMINOLOGY 219 <summary> 220 Entry point of application. 221 </summary> 222 <remarks> 223 In this application all command-line arguments 224 are ignored. 225 </remarks> 226 <param name= "args" > 227 Optional arguments to Main. 228 </param> 229 </member> 230 231 </members> 232 </doc> /// (documentation comment) name attribute of member element Build Comment Web Pages para element c element param element class definition parameters constructor property creating XML documentation reference directory remarks element documentation return value Documentation column returns element HTML see element instance variable source code interface definition style sheet member summary element member element tag Members column value element method declaration XML documentation comment Fig. E.8 Fig. E.8 XML documentation generated by Visual Studio .NET. (Part 6 of 6.)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Appendix E Generating Documentation in Visual Studio 1347 SUMMARY • Programmers should document specific information on a class, such as the class’s role in a system, the functionality that each method provides for the class and the purpose of each class variable. • Documentation helps all programmers understand how classes can interoperate, as well as facilitate modification, use and extension of each class. • Visual Studio .NET provides the XML documentation tool. This tool converts key piec- es of information in the code—such as the class’s members, the hierarchy to which the class belongs and any other general remarks the programmer wishes to document—to HTML or XML format. • The programmer specifies the general remarks to be documented by placing them in spe- cial regions in the code, called XML documentation comments.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/23/2011 for the course ENG 512 taught by Professor Skinner during the Fall '10 term at BU.

Page1 / 11

C# How to Program43_2 - csphtp1.book Page 1346 Wednesday...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online