VisualBuilder
  Home > Csharp > Tutorials > Generating Help File in C sharp - C# Tutorial
Tell a friend
Link to us
Total Members
      Members: 84606
     
Sitemap Forum Chat
Home
C# Tutorial Home
1 . Introduction to C sharp
2 . Control Statement: Selection Statement in C sharp
3 . Control Statements – Loops Statement
4 . Methods
5 . Namespaces
6 . Introduction to Classes:
7 . Inheritance:
8 . Polymorphism
9 . Properties
10 . Indexers
11 . Structs
12 . Interfaces
13 . Delegates:
14 . Exception Handling:
15 . Attributes
16 . Enums
17 . Encapsulation
18 . Parameter Passing in C sharp
19 . Method Overloading
20 . Database Interaction Using C sharp
21 . Operator Overloading in C sharp -1
22 . Operator Overloading in C sharp -2
23 . Operator Overloading in C sharp -2
24 . Sockets
25 . DNS [Domain Name System]
26 . Working with Files
27 . Generating Help File in C sharp
28 . Code Access Security
29 . Multi-Threading
30 . Globalization and Localization -1
31 . Working with Registry in C sharp
32 . Globalization and Localization -2
33 . Windows Service
34 . Web Service
35 . Consuming Web Services
36 . Creating Proxy Object of Web Service
37 . Creating an XML document
38 . Reading XML document in C sharp
39 . Using XMLWriter class to Write XML document in C sharp
40 . Assembly Information : Getting Permission set of the assembly
41 . Creating your own Permission Set
42 . Using C sharp Socket
 
Csharp Group Home
Csharp Discussion (7)
Csharp Members (2250)
Csharp Resources
Csharp Source Code (35)
Csharp Articles (0)
Csharp Blogs
Csharp Jobs
Csharp Components (5)
Csharp Books
Csharp Websites (25)
Csharp News (17)
Csharp Q & A (4)
- Csharp Ask Question
- Csharp Questions
- Csharp Unanswered Questions
 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.NET Development Tips
ASP.Net Security,Internationalisation And Deployment
ASP.NET Server Controls Tips
ASP.NET Tutorial
C Sharp Tutorial
LINQ Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Javascript Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Grails Tutorial
Hibernate Tutorial
Java 1.6 Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Service-Oriented Architecture (SOA) Tutorial For Managers
Spring Tutorial
Struts Tutorial
Tomcat Tutorial

RESOURCES
Q & A (432 )
Source Code (3217 )
Articles (11 )
Components (1589 )
News (880 )
Websites (1207 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Link To Us
Feedback
Tell a Friend
Partners
Advertise


Csharp Tutorial
 Generating Help File in C sharp
  << Prev: Working with Files Next: Code Access Security >>

An interesting feature of the C# compiler is to generate XML documentation from the comments. C# compiler reads specially formatted comments and generates XML documentation from the comments. You can then displays this XML on the Web to provide an extra level of documentation to developers who need to understand the structure of your applications.


 


Pre-requisites to generate XML documentation from the comments are:



  • Use three slashes for comments(///). The C# compiler does not generate any XML Documentation for any comments that do not begin with three slashes. Nor does the C# compiler generates any XML documentation for regular, multi line, comments.

  • Use the /doc option of the C# compiler to specify the name of the file that should contain the generated XML documentation.


 


Example: Demonstrate XML documentation from Comments


 


Step1: In the first step we create the C# code file.


 


using System;


using System.Collections.Generic;


using System.Windows.Forms;


 


namespace _CSharpApplication


{


  static class Program


    {


    /// <summary>


    /// The main entry point for the application.


    /// Developed By : C# Team


    /// Developed On : 21 Oct,07


    /// </summary>


    [ STAThread ]


    static void Main ()


        {


        Application .EnableVisualStyles();


        Application .SetCompatibleTextRenderingDefault( false );


                System.Console.WriteLine( "StartUp for C# World!" );


        }


    }


}


Step2: The following command is used to generate the help file. The command will create two files i.e. “Program.exe” and other is “ProgramHelpFile.xml” .


 


Command: csc /doc: HelpFile.xml ProgramFile.cs


 


   


Output:-


The following xml will be generated by the above command.


 


ProgramHelpFile.xml


 


<?xml version="1.0"?>


<doc>


    <assembly>


        <name>Program</name>


    </assembly>


    <members>


        <member name="M:_CSharpApplication.Program.Main">


            <summary>


            The main entry point for the application.


            Developed By : C# Team


            Developed On : 21 Oct,07


            </summary>


        </member>


    </members>


</doc>


 


Note: -Main portion of XML documentation is found in <member> element: This element contains one <member> tag for each documented item in the source code. The <member> tag contains one attribute, name, which names the member being documented. The value of the name attribute starts with a one-letter prefix describing the type of information being described. Options for the first letter of the name attribute's value and its meaning. <member> “name” = Attribute Prefixes >


 


Other Important Tags:


 


The following is the list of more help file tags which can be used in the C#.



  1. <c>:- T ag to indicate that a small part of your comment should be treated as code. Style sheets may use this element to display the code portion of your comment E.g. /// This is the <c> Main ()</c> function for the /// Program class.

  2. <code>:- Tag to indicate that multiple lines of text in your comments should be treated as code: E.g.
    /// <code>
    /// Argument[0]: command line argument 1
    /// Argument[1]: command line argument 2
    /// Argument[2]: command line argument 3
    /// </code>

  3. <exception>:- You can use the <exception> tag to document any exceptions that may be raised from the member's code. The <exception> tag must contain an attribute called cref whose value specifies the type of exception being documented. The cref attribute value must be enclosed in quotes. The text of the element describes the conditions under which the exception is thrown: E.g.
    /// <exception cref="System.Exception">
    /// Raised if the input is less than 0.
    /// </exception>

  4. <permission>:- Use the <permission> tag to document the permissions available on a given function or variable. Access to a class's code and data can mean access to all of the code or it can be restricted to a certain subset of code. You can use the <permission> tag to document the availability of your code and data. The <permission> tag makes use of one attribute: cref. The value of the cref element must name the function or variable whose permissions are being documented: E.g.
    /// <permission name="Main()">
    /// Everyone can access Main ().
    /// </permission>

  5. <remarks>:- Use the <remarks> tag to add information about an item. The <remarks> element is great for providing an overview of a method or variable and its usage. The <remarks> tag carries no attributes and its text contains the remarks: E.g.
    /// <remarks>
    /// The Main () function is the entry point into the
    /// application. The CLR will call Main () to start
    /// the application after the application loads
    /// </remarks>


  << Prev: Working with Files Next: Code Access Security >>
Csharp Tutorial Home
Give feedback and win a prize.

 
   Printer Friendly
   Email to a friend
   Add to my Favourites    
  Download PDF version
   Report Bad Submissions
   Submit Feedback
 
  Delicious   Digg   Technorati   Blink   Furl   Reddit   Newsvine   Google Click each image to add
this page to each site.
 
 
Welcome Guest Signup
MEMBER'S PANEL
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!
 
SEARCH
 
 
LINKS
VoIP Internettelefonie
Gift to Pakistan
 
ADVERTISEMENT
 
PARTNER LIST

More
 
 
 

Home | Login | About Us | Contact Us | Privacy Policy | Advertising