C# How to Program43_2

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

Info icon This 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 XML documentation generated by Visual Studio .NET. (Part 6 of 6.)
Image of page 1

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

View Full Document Right 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.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern