转载自http://www.cnblogs.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 == );
}
return result;
}
}
}

代码很简单,注意其中的XML注释。

打开项目的属性,在“Build”选项中,确保“XML documentation file:”被选中了。

第二步,编译这个项目,你会看到生成的DLL文件和XMl文件:

第三步,打开 Sandcastle Help File Builder

打开Sandcastle Help File Builder并新建一个项目:

为Sandcastle Help File Builder项目添加编译生成的DLL文件,右键点击项目右边的“Documentation Sources",选择“Add Documentation Source...”

选择刚刚生成的DLL文件。

第四步,修改设置

在项目的属性窗口,你可以根据需要修改一些设置。

第五步,生成文档

点击Build the help file来生成文档。

这是最终生成的文档:

ahjesus 创建msdn一样的帮助文档的更多相关文章

  1. Mongodb 笔记02 创建、更新和删除文档

    创建.更新和删除文档          1. 插入并保存: 1). 单条插入,insert : db.foo.insert({"bar":"baz"}) 2). ...

  2. 使用docx4j编程式地创建复杂的Word(.docx)文档

    原文链接:Create complex Word (.docx) documents programatically with docx4j 原文作者:jos.dirksen 发表日期:2012年2月 ...

  3. elasticsearch _create api创建一个不存在的文档

    https://www.elastic.co/guide/cn/elasticsearch/guide/current/create-doc.html当我们索引一个文档, 怎么确认我们正在创建一个完全 ...

  4. 创建 VuePress + GithubPages + TravisCI 在线文档

    目录 最终效果 思路 总体 过程 用到的东西 相关 创建Github仓库 创建Github仓库 SSH密钥链接Github 生成SSH密钥 Github添加SSH密钥 测试SSH密钥 配置VuePre ...

  5. 创建Sphinx + GitHub + ReadtheDocs托管文档

    最新博客链接 "Tsanfer's Blog" 创建Sphinx + GitHub + ReadtheDocs托管文档 Readthedocs在线电子书链接

  6. MongoDb 创建、更新以及删除文档常用命令

    mongodb由C++写就,其名字来自humongous这个单词的中间部分,从名字可见其野心所在就是海量数据的处理.关于它的一个最简洁描述为:scalable, high-performance, o ...

  7. MongoDB学习笔记二:创建、更新及删除文档

    插入并保存文档 对目标集使用insert方法插入一个文档: > db.foo.insert({"bar" : "baz"}) 这个操作会给文档增加一个&q ...

  8. MongoDB学习笔记-创建、更新、删除文档

    创建     MongoDB中使用insert方法来向集合插入文档,然后保存到MongoDB中.     db.foo.insert({"hehe":"呵呵"} ...

  9. 创建、更新、删除文档。 --- Mongodb权威指南阅读。

    插入文档: db.foo.insert({ "key" : "value"}); 使用insert插入一个数据,文档中如果没有_id 会自动给文档增加_id. ...

随机推荐

  1. AppScan学习笔记

    AppScan学习笔记 http://www.docin.com/p-777386896.html

  2. python 字符串比较

    cmp方法比较两个对象,并根据结果返回一个整数.cmp(x,y)如果X< Y,返回值是负数 如果X>Y 返回的值为正数. sStr1 = 'strch'sStr2 = 'strchr'pr ...

  3. adb permission denied

    1.没有得到root权限,可以用刷机精灵一键root. 2.root不彻底,手机安装超级adbd,即可.

  4. vbox导入虚拟电脑网卡MAC问题

    vbox导入虚拟电脑之后,需要"重新初始化所有网卡的MAC地址". centos需要做以下几步操作: 1.删除文件"/etc/udev/rules.d/70-persis ...

  5. Entity Framework Code First ---EF Power Tool MySql

    关于如何使用EF Power Tool的介绍请看 http://www.cnblogs.com/LingzhiSun/archive/2011/05/24/EFPowerTool_1.html, 这里 ...

  6. C# 读取压缩文件方式及乱码处理

    目前主流的压缩文件操作类,除了C#原生的.还有 1. ZIP-DotNetZip 网址:http://dotnetzip.codeplex.com/ 2 7Zip-SevenZipSharp 网址:h ...

  7. AssetBundle系列——游戏资源打包(二)

    本篇接着上一篇.上篇中说到的4步的代码分别如下所示: (1)将资源打包成assetbundle,并放到自定目录下 using UnityEditor; using UnityEngine; using ...

  8. excel导入记录

    use DangJianSELECT vale1, value2 into Table2 from Table1 select COUNT(*) from tmpdangyuan where 手机号 ...

  9. 【转载】给VM虚拟机增加硬盘容量

    转载自:http://www.douban.com/note/53678368/ vmware-vdiskmanager [选项]这里的选项你必须包含以下的一些选择项或参数选项和参数描述<dis ...

  10. Hadoop第9周练习—Hive部署测试(含MySql部署)

    1.1 2 :搭建Hive环境 内容 2.2 3  运行环境说明 1.1  硬软件环境 线程,主频2.2G,6G内存 l  虚拟软件:VMware® Workstation 9.0.0 build-8 ...