. Net document generation tool ADB [update to 2.3]

Source: Internet
Author: User

Download adb2.3 Adb2.3 source code downloadMicrosoft HTML Help WorkshopDownload

Note: You must install the software first.Microsoft HTML Help Workshop

ProgramAnnotations play a very important role in programming and maintenance. in Visual C #,CodeCreate a document by referring to the code block marked in XML, directly inSource codeContains XML tags. During compilation, the compiler searches for all XML tags in the source code and creates an XML document file .. Net document generation tool (Hereinafter referred to as ADBCreates an API document in the msdn format through the reflection assembly and XML annotations in its code.

1. Features of adb2.3:

(1) generate a document similar to msdn according to the Assembly and its corresponding XML file, and package it into a CHM file;

(2) Merge documents corresponding to multiple assembly into one document;

(3) automatically search for the XML documents corresponding to the Assembly and its referenced assembly (including. NET Self-Contained Assembly, such as system. XML );

(4) flexible control of the members displayed in the document (for example, only generate public methods );

(5) user-friendly and easy to operate.

(6) users can expand the XML mark according to their own needs;

(7) You can write custom document generators as needed.

2. annotation tags supported by adb2.3

3. adb2.3 User Guide

Shows how to use adb2.3:

(1) Main Interface:

(2) Batch selection:

4. generated document

(1) namespace page:

2. Type page:

3. Member page:

5. Develop a custom document Generator

Adb2.3Supports loading custom document generators. You can develop document generators based on your needs. The following describes how to develop custom document generators.MybuilderFor example, describe how to develop a custom document generator:

(1) Objectives:

Develop a custom document builder that extends the following functions based on the ADB default document builder:

A.InXMLDocument comments can be used<Image>Insert an image;

B.Add a content section named "Custom section" to the Type page and member page.

(2) development steps

A.Click menu Tools->Custom document generation solution->ExtensionXMLEnter the document builder name in the pop-up dialog box.

B.Open ProjectMybuilder. CSFile, enter the following code

 Using System; Using System. Collections. Generic; Using System. text; Using ADB. factories; Using Microsoft. VisualBasic. fileio; Namespace Custombuilder {/// <Summary> ///  Mybuilder  /// </Summary>  Public class  Mybuilder : ADB. Factories. msdnstylechmdocumentbuilder { Static Pagesection [] _ memberpagesections, _ typepagesections; Public Mybuilder (igetdata data, iinteract interact ): Base (Data, interact ){ // Base. memberpagesections is the original section of the page. You can insert the custom section to the end of the page. _ Memberpagesections = New Pagesection [Base . Memberpagesections. Length + 1]; Base . Memberpagesections. copyto (_ memberpagesections, 0); _ memberpagesections [ Base . Memberpagesections. Length] = New Pagesection ( "Custom section" , Pagesectiontype. fromxml, "Customsection" ); // Base. memberpagesections is the original section of the page. You can insert the custom section to the end of the page. _ Typepagesections = New Pagesection [ Base . Typepagesections. Length + 1];Base . Typepagesections. copyto (_ typepagesections, 0); _ typepagesections [ Base . Typepagesections. Length] = New Pagesection ( "Custom section" , Pagesectiontype. fromxml, "Customsection" );} // Rewrite the memberpagesections attribute of the base class.  Public override Pagesection [] memberpagesections { Get { Return _ Memberpagesections ;}}// Override the typepagesections attribute of the base class  Public override Pagesection [] typepagesections { Get { Return _ Typepagesections ;}} Protected override string Gettag (system. xml. xmlelement ELEM, String Xmlfile ){ Switch (ELEM. Name ){ Case  "Customsection" :{ // Generate the content of "Custom section" Return Getinnertags (ELEM, xmlfile );} Case  "Image" :{ Stringbuilder Tag = New  Stringbuilder (); String Src = ELEM. getattribute ( "Src" ); If (! String . Isnullorempty (SRC )){ Try { // Copy the image to the directory on the generated page // (use the htmlfiledirectory attribute to obtain the directory on which the page is saved) Filesystem. copyfile (xmlfile + "\\" + SRC, htmlfiledirectory + "\\" + SRC, True );} Finally {} // Generate HTML flag Tag. appendformat ( " , Src );} Return Tag. tostring ();} Default :{ // Other flags are processed by the base class  Return Base . Gettag (ELEM, xmlfile );}}}}}

C.Click the debug button to debug the custom document generator. 

(3) test

The test classes and theirXMLNote:

NamespaceClasslibrary1 {/// <Summary> ///Class Abstract/// </Summary> /// <customsection> ///Custom Section/// <Image src = "1.gif"/> /// </customsection>Public classClass1{}}

Use custom document BuilderMybuilderGenerated document

(4) LetADBAutomatically load the document generator at startup

InADBCreate a directory under the DirectoryMybuilder, AndMybuilder. dllAndMybuilder. BuilderCopy to this folder

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.