Add description text for your class

Source: Internet
Author: User

Tutorial
C # provides a mechanism for developers to archive their code using XML. In the source code file, the following code lines can be processed as comments and placed in the file: rows starting with //; in user-defined types (such as classes, delegates, or interfaces), a member (such as a field, event, attribute or method) or a row before a namespace declaration.
Example
The following example provides a basic overview of an archived type. To compile this example, type the following command line:
Csc XMLsample. cs/doc: XMLsample. xml
This will create the XML file XMLsample. xml, which can be viewed in a browser or by using the TYPE command.
// XMLsample. cs
// Compile with:/doc: XMLsample. xml
Using System;
/// <Summary>
/// Class level summary documentation goes here. </summary>
/// <Remarks>
/// Longer comments can be associated with a type or member
/// Through the remarks tag </remarks>
Public class SomeClass
{
/// <Summary>
/// Store for the name property </summary>
Private string myName = null;
/// <Summary>
/// The class constructor. </summary>
Public SomeClass ()
{
// TODO: Add Constructor Logic here
}

/// <Summary>
/// Name property </summary>
/// <Value>
/// A value tag is used to describe the property value </value>
Public string Name
{
Get
{
If (myName = null)
{
Throw new Exception ("Name is null ");
}
Return myName;
}
}
/// <Summary>
/// Description for SomeMethod. </summary>
/// <Param name = "s"> Parameter description for s goes here </param>
/// <Seealso cref = "String">
/// You can use the cref attribute on any tag to reference a type or member
/// And the compiler will check that the reference exists. </seealso>
Public void SomeMethod (string s)
{
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.