转载自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. visual studio 2013使用技巧

    去掉 引用提示 文本编辑器=>所有语言=>codelens visual studio 由于以前的函数求值超时,函数求值被禁用.必须继续执行才能重新启用函数求值 visual studio ...

  2. 图解 Java IO : 二、FilenameFilter源码

    Writer      :BYSocket(泥沙砖瓦浆木匠) 微         博:BYSocket 豆         瓣:BYSocket FaceBook:BYSocket Twitter   ...

  3. sencha touch api 使用指南

    本文主要讲解如何使用sencha touch的api以及如何查看api中官方示例源码 前期准备 1.sdk 下载地址:http://www.sencha.com/products/touch/down ...

  4. Java NIO原理分析

    Java IO 在Client/Server模型中,Server往往需要同时处理大量来自Client的访问请求,因此Server端需采用支持高并发访问的架构.一种简单而又直接的解决方案是“one-th ...

  5. 重构第3天:方法提公(Pull Up Method)

    理解:方法提公,或者说把方法提到基类中. 详解:如果大于一个继承类都要用到同一个方法,那么我们就可以把这个方法提出来放到基类中.这样不仅减少代码量,而且提高了代码的重用性. 看重构前的代码: usin ...

  6. crontab 定时调度

    crontab -e */1 8-23 * * * /www/target/sh/myorder.sh & 0 1 * * * /www/target/php/sh/mymoney.sh &a ...

  7. Cloning EBS from Linux 5 to Linux 6 Fails: "Error While Loading Shared Libraries: libclntsh.so.10.1

    SYMPTOMS    During clone Oracle Applications R12 from Linux 5 to Linux 6 the following error occurs ...

  8. VC6.0 error LNK2001: unresolved external symbol _main解决办法

    学习VC++时经常会遇到链接错误LNK2001,该错误非常讨厌,因为对于编程者来说,最好改的错误莫过于编译错误,而一般说来发生连接错误时,编译都已通过.产生连接错误的原因非常多,尤其LNK2001错误 ...

  9. 在linux安装mysql,并设置远程访问

    1.查看系统有没有安装mysql. vpm -qa mysql 发现有删除:rpm -e mysql(rpm -e --nodeps mysql) 2.下载数据库 mysql-standard-5.0 ...

  10. NGUI之UIRoot屏幕分辨率自适应

    NGUI在Unity3D游戏开发中非常常用,而NGUI对于每一个UI场景,都是以一个UIRoot为UI游戏对象树的根的,那么这个UIRoot是起什么作用的呢? 先简单看一下UIRoot中的基本属性 U ...