9: Well-Formed Types in Visual C#

Encode QR Code 2d barcode in Visual C# 9: Well-Formed Types
9: Well-Formed Types
Print QR Code JIS X 0510 In C#.NET
Using Barcode generator for .NET Control to generate, create QR Code ISO/IEC18004 image in .NET applications.
Figure 92: XML Comments as Tips in Visual Studio IDE
Creating Bar Code In C#
Using Barcode generator for .NET framework Control to generate, create bar code image in .NET applications.
These coding tips offer significant assistance in large programs, especially when multiple developers share code For this to work, however, the developer obviously must take the time to enter the XML comments within the code and then direct the compiler to create the XML file The next section explains how to accomplish this
Denso QR Bar Code Generator In .NET Framework
Using Barcode creation for ASP.NET Control to generate, create Quick Response Code image in ASP.NET applications.
Associating XML Comments with Programming Constructs Consider the listing of the DataStorage class, as shown in Listing 917
Encoding QR-Code In .NET
Using Barcode generation for Visual Studio .NET Control to generate, create QR-Code image in .NET applications.
Listing 917: Commenting Code with XML Comments
QR Code ISO/IEC18004 Printer In VB.NET
Using Barcode generation for .NET Control to generate, create QR Code image in .NET applications.
/// <summary> /// DataStorage is used to persist and retrieve /// employee data from the files /// </summary> class DataStorage { /// <summary> /// Save an employee object to a file /// named with the Employee name /// </summary> /// <remarks> /// This method uses /// <seealso cref="SystemIOFileStream"/> /// in addition to /// <seealso cref="SystemIOStreamWriter"/>
Generate Barcode In Visual C#.NET
Using Barcode creator for VS .NET Control to generate, create bar code image in VS .NET applications.
Single-Line XML Comment
Encoding Barcode In C#
Using Barcode drawer for .NET framework Control to generate, create barcode image in .NET applications.
XML Comments
Code 39 Creator In C#.NET
Using Barcode drawer for Visual Studio .NET Control to generate, create Code39 image in .NET applications.
/// </remarks> /// <param name="employee"> /// The employee to persist to a file</param> /// <date>January 1, 2000</date> public static void Store(Employee employee) { // } /** <summary> * Loads up an employee object * </summary> * <remarks> * This method uses * <seealso cref="SystemIOFileStream"/> * in addition to * <seealso cref="SystemIOStreamReader"/> * </remarks> * <param name="firstName"> * The first name of the employee</param> * <param name="lastName"> * The last name of the employee</param> * <returns> * The employee object corresponding to the names * </returns> * <date>January 1, 2000</date>**/ public static Employee Load( string firstName, string lastName) { // } } class Program { // }
Making USS Code 128 In C#.NET
Using Barcode printer for Visual Studio .NET Control to generate, create Code128 image in Visual Studio .NET applications.
XML Delimited Comment (C# 20)
Encoding DataMatrix In C#.NET
Using Barcode generator for VS .NET Control to generate, create Data Matrix image in .NET framework applications.
Listing 917 uses both XML delimited comments that span multiple lines, and single-line XML comments where each line requires a separate threeforward-slash delimiter (///) Since XML comments are designed to document the API, they are intended for use only in association with C# declarations, such as the class
Encode European Article Number 13 In .NET Framework
Using Barcode drawer for .NET Control to generate, create European Article Number 13 image in .NET applications.
9: Well-Formed Types
Barcode Encoder In Visual Studio .NET
Using Barcode encoder for ASP.NET Control to generate, create bar code image in ASP.NET applications.
or method shown in Listing 917 Any attempt to place an XML comment inline with the code, unassociated with a declaration, will result in a warning by the compiler The compile makes the association simply because the XML comment appears immediately before the declaration Although C# allows any XML tag in comments, the C# standard explicitly defines a set of tags to be used <seealso cref="SystemIOStreamWriter"/> is an example of using the seealso tag This tag creates a link between the text and the SystemIOStreamWriter class
Barcode Encoder In .NET
Using Barcode drawer for .NET framework Control to generate, create bar code image in Visual Studio .NET applications.
Generating an XML Documentation File The compiler will check that the XML comments are well formed, and will issue a warning if they are not To generate the XML file, you need to use the /doc option when compiling, as shown in Output 98
Data Matrix ECC200 Reader In .NET
Using Barcode recognizer for .NET Control to read, scan read, scan image in VS .NET applications.
OUTPUT 98:
Barcode Encoder In Visual Basic .NET
Using Barcode creator for VS .NET Control to generate, create bar code image in .NET applications.
>csc /doc:Commentsxml DataStoragecs
UPC-A Creation In Java
Using Barcode creation for Java Control to generate, create UPC A image in Java applications.
The /doc option will create an XML file based on the name specified after the colon Using the CommentSamples class listed earlier and the compiler options listed here, the resultant CommentSamplesXML file appears as shown in Listing 918
Data Matrix 2d Barcode Creator In Java
Using Barcode printer for Java Control to generate, create Data Matrix ECC200 image in Java applications.
Listing 918: Commentsxml
European Article Number 13 Generation In Java
Using Barcode encoder for Java Control to generate, create EAN 13 image in Java applications.
< xml version="10" > <doc> <assembly> <name>DataStorage</name> </assembly> <members> <member name="T:DataStorage"> <summary> DataStorage is used to persist and retrieve employee data from the files </summary> </member> <member name="M:DataStorageStore(Employee)"> <summary> Save an employee object to a file
Generate Barcode In VS .NET
Using Barcode creator for ASP.NET Control to generate, create barcode image in ASP.NET applications.
XML Comments
Barcode Generator In Java
Using Barcode creation for Java Control to generate, create bar code image in Java applications.
named with the Employee name </summary> <remarks> This method uses <seealso cref="T:SystemIOFileStream"/> in addition to <seealso cref="T:SystemIOStreamWriter"/> </remarks> <param name="employee"> The employee to persist to a file</param> <date>January 1, 2000</date> </member> <member name="M:DataStorageLoad( SystemString,SystemString)"> <summary> Loads up an employee object </summary> <remarks> This method uses <seealso cref="T:SystemIOFileStream"/> in addition to <seealso cref="T:SystemIOStreamReader"/> </remarks> <param name="firstName"> The first name of the employee</param> <param name="lastName"> The last name of the employee</param> <returns> The employee object corresponding to the names </returns> <date>January 1, 2000</date>* </member> </members> </doc>
The resultant file includes only the amount of metadata that is necessary to associate an element back to its corresponding C# declaration This is important to note, because in general, it is necessary to use the XML output in combination with the generated assembly in order to produce any meaningful documentation Fortunately, tools such as the free GhostDoc3 and the open source project NDoc4 can generate documentation
3 See http://submaincom/ to learn more about GhostDoc 4 See http://ndocsourceforgenet to learn more about NDoc