国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

ahjesus 創建msdn一樣的幫助文檔

2019-11-17 03:14:44
字體:
來源:轉載
供稿:網友

ahjesus 創建msdn一樣的幫助文檔

轉載自http://m.survivalescaperooms.com/DotNetNuke/archive/2009/04/23/1441899.html

使用SandCastle創建.Net幫助文檔

Sandcastle是微軟提供的一個根據xml注釋和DLL文件生成幫助文件的工具,目前是在CodePlex上的一個開源項目,可以去這里下載:Sandcatle 項目Sandcastle 本身是一個console的程序,為了方便使用,我們可以使用他的GUI版本:Sandcastle Help File Builder

第一步,為你寫的代碼添加XML注釋

我們創建一個簡單的ClassLibrary1項目最為示范:

using System;using System.Collections.Generic;using System.Text;namespace ClassLibrary1{    /// <summary>    /// A sample class to show something using Sandcastle    /// </summary>    public class SampleClass    {        PRivate string _propertyValue;         /// <summary>        /// Gets or sets the property value.        /// </summary>        /// <value>The property value.</value>        public string Property        {            get            {                return _propertyValue;            }            set            {                _propertyValue = value;            }        }         /// <summary>        /// Determines whether the property is null.        /// </summary>        /// <returns>        ///     <c>true</c> if property is null; otherwise, <c>false</c>.        /// </returns>        public bool IsPropertyNull()        {            bool result = false;            if (this.Property == null)            {                result = true;            }            return result;        }         /// <summary>        /// Determines whether the property is null.        /// </summary>        /// <returns>        ///     <c>true</c> if property is empty; otherwise, <c>false</c>.        /// </returns>        /// <example>        /// This example shows how you might use this method:        ///         /// <code>        /// SampleClass sample = new SampleClass();        ///         /// if (sample.IsPropertyEmpty())        /// {        ///        Console.WriteLine("The property is empty");        /// }        /// else        /// {        ///        Console.WriteLine("The property contains value " + sample.Property);        /// }        /// </code>        /// </example>        public bool IsPropertyEmpty()        {            bool result = this.IsPropertyNull();            if (!result)            {                result = (Property.Trim().Length == 0);            }            return result;        }    }}

代碼很簡單,注意其中的XML注釋。

打開項目的屬性,在“Build”選項中,確保“XML documentation file:”被選中了。

image

第二步,編譯這個項目,你會看到生成的DLL文件和XMl文件:

image

第三步,打開 Sandcastle Help File Builder

打開Sandcastle Help File Builder并新建一個項目:

image

為Sandcastle Help File Builder項目添加編譯生成的DLL文件,右鍵點擊項目右邊的“Documentation Sources",選擇“Add Documentation Source...”

image

選擇剛剛生成的DLL文件。

image

第四步,修改設置

在項目的屬性窗口,你可以根據需要修改一些設置。

image

第五步,生成文檔

image

點擊Build the help file來生成文檔。

這是最終生成的文檔:

image


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 正定县| 巴南区| 蓝田县| 柯坪县| 汕尾市| 富平县| 兰考县| 略阳县| 大竹县| 城市| 和平县| 嘉兴市| 汶川县| 武隆县| 丰台区| 沅江市| 双辽市| 和平县| 鄂州市| 福贡县| 湘潭市| 漳浦县| 大英县| 修文县| 杂多县| 广东省| 肥乡县| 灵武市| 萨迦县| 临西县| 高阳县| 福建省| 永善县| 桑植县| 即墨市| 利辛县| 南召县| 濮阳市| 临桂县| 陆良县| 洪雅县|