转载自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. datagridview设置currentrow为指定的某一行[转]

    最近由于程序需要,需要实现指定的行为datagridview的currentrow ,当我设置 dataGridView1.Rows[i].Selected = true时,刷新后,界面显示是当前行被 ...

  2. 自定义StyleCop规则

    参考:StyleCopSDK.chm与 Byeah的 编写StyleCop自定义规则教程(一)---编写中文备注的简单校验规则 1.建立“类库”类型的C#项目 2.加入 Microsoft.Style ...

  3. 一些常用的Git命令

    1 删除文件 $ git rm filename 从已跟踪文件清单中移除,并连带从工作目录中删除指定的文件. 删除后,有2种选择: (1)如果确实要删除,则使用git commit提交. (2)如果不 ...

  4. c++中两个类互相引用的问题

    最近在改一个C++程序的时候碰到一条警告信息,警告信息为:“ 删除指向不完整“Q2DTorusNode”类型的指针:没有调用析构函数                1> c:\users\lxw ...

  5. Http 1.1协议

    HTTP是hypertext transfer protocol(超文本传输协议)的简写,它是TCP/IP协议的一个应用层协议,用于定义WEB浏览器与WEB服务器之间数据交换的过程. 1.Http1. ...

  6. git clone简介

    翻译整理自: http://web.mit.edu/~mkgray/project/silk/root/afs/sipb/project/git/git-doc/git-clone.html  在使用 ...

  7. Java框架篇---Mybatis 构建SqlSessionFactory

    从 XML 中构建 SqlSessionFactory 基于 MyBatis 的应用都是以一个 SqlSessionFactory 的实例为中心的.SqlSessionFactory 的实例可以通过 ...

  8. Sql Server 系统表功能

    SELECT Name FROM Master..SysDatabases ORDER BY Name

  9. SuperSocket 1.6.4 通过FixedHeaderReceiveFilter解析自定义协议

    SuperSocket 提供了一些通用的协议解析工具, 你可以用他们简单而且快速的实现你自己的通信协议: TerminatorReceiveFilter (SuperSocket.SocketBase ...

  10. Asphyre 更名pxl 终于全面支持跨平台了.Delphi饭们 激动了吧.

    Asphyre We are happy to announce the official release of our latest framework Pascal eXtended Librar ...