Home > Microsoft .Net Development Tips > C# Development > Creating online documentation
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

C# DEVELOPMENT

Creating online documentation


Kamran Shakil
03.31.2003
Rating: -3.00- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Please let other users know how useful this tip is by rating it below. Got a tip or code of your own you'd like to share? Submit it here!


C# allows automatic generation of comments in XML format. XML is similar to HTML. Let's concentrate on C#. Note that all programs in this lessons need to be compiled with the option /doc. For example, if you save the program below in a file hello.cs and want to generate hello.xml, you would type csc /doc:hello.xml hello.cs. To generate an XML file from a C# program, we add triple slash comments ///. The simplest comment starts with a keyword <summary> and ends with a keyword </summary>. Comments should be placed just before the line of code they are annotating.

//This is just a comment 
using System; 
///<summary> class Test has only one method </summary> 
class Test 
{ 
    ///<summary> string z contains identifier to output </summary> 
    private static string z="Hello"; 
    ///&lsummary> method Main is an entry point of the program </summary> 
    public static void Main() 
    { 
    Console.WriteLine(z); 
    } 
}  

Let's look inside hello.xml, which captures the general structure of the program hello.cs. Here is a small dictionary:

T    Type. Class Test is a type. 
 
F    Class member. z is a data member of class Test. 
 
M    Method. Main is a method of class Test. 
 
!    Error. Dead link. 

P    Property.

<?xml version="1.0" ?>

<doc>
<assembly>
  <name>cs</name> 
  </assembly>
  <members>
  <member name="T:Test">
  <summary>class Test has only one method</summary> 
  </member>
  <member name="F:Test.z">
  <summary>string z contains identifier to output</summary> 
  </member>
  <member name="M:Test.Main">
  <summary>method Main is an entry point of the program</summary>
  </member>
  </members>
</doc>

Other interesting commands are:

  • <see also cref= "Something"/> gives a link to Something, which must be in your program file. <para> and </para> mark the begining and the end of the paragraph.

  • <remarks> </remarks> -- similar to <summary>


    Source: DotNetExtreme.com

    Rate this Tip
    To rate tips, you must be a member of SearchWinDevelopment.com.
    Register now to start rating these tips. Log in if you are already a member.




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



    RELATED CONTENT
    C# Development
    Let Microsoft StyleCop tame your wild C#
    Picking a .NET smart client communications technology
    LINQ beyond queries: Strong-typed refection
    Book excerpt: An introduction to DSL tools
    Assembly versioning in the .NET Framework 2.0
    Book excerpt: Creating graphical output using the .NET Compact Framework
    On Extension Methods in C# and .NET Framework 3.5
    Generate RSA public and private keys, export to XML
    Book excerpt: Upgrading to Visual Studio 2005
    Learning .NET: Tips for getting started with .NET development

    .NET Framework development with XML and XAML
    Embarcadero RAD Studio 2010
    How to write an out-of-browser Silverlight 3 application in 3 steps
    Ajax Learning Guide
    Ajax Learning Guide
    Open XML SDK ready for the road
    XAML as an everywhere presentation format
    Silverlight Spy scans XAML objects, eases JavaScript debugging
    Java presentation tool outputs XAML files
    Microsoft, Cisco et al. to partner on modeling language
    Microsoft's XAML recasts UI development

    C# programming language
    Inside Visual Studio 2010
    Mono 2.0 moves .NET apps to Linux - includes migration analyzer
    LINQ beyond queries: Strong-typed refection
    Assembly versioning in the .NET Framework 2.0
    Book excerpt: Creating graphical output using the .NET Compact Framework
    Visual Studio 2008 Learning Guide: C# 3.0
    Simonyi firm to address divide between domain experts and developers
    On Extension Methods in C# and .NET Framework 3.5
    Generate RSA public and private keys, export to XML
    Book excerpt: Upgrading to Visual Studio 2005

    RELATED GLOSSARY TERMS
    Terms from Whatis.com − the technology online dictionary
    Atlas  (SearchWinDevelopment.com)
    RSS  (SearchWinDevelopment.com)
    Silverlight  (SearchWinDevelopment.com)
    Windows Communication Foundation  (SearchWinDevelopment.com)

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



  • Database Programming Solutions - .NET XML, Visual Studio LINQ, ORM .NET
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts