热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ndoc2007_使用C#,NDoc,Lutz的Documentor和MicrosoftHTML帮助研讨会的有效XML文档

ndoc2007Alothasbeensaidonthistopic,butheressomestuffyoumightnotknow.关于这个话题已经说了很多,但是
ndoc2007

ndoc2007

A lot has been said on this topic, but here's some stuff you might not know.

关于这个话题已经说了很多,但是这里有些东西你可能不知道。

We use NDoc to document our API.  NDoc consumes the XML Documentation files created as a build artifact by the C# compiler. 

我们使用NDoc来记录我们的API。 NDoc使用C#编译器创建的XML文档文件作为构建工件。

  • Here is the list of recommended XML Documentation tags from Microsoft.

    这是Microsoft推荐的XML Documentation标记的列表。

  • Here is the extended list of tags supported by NDoc

    这是NDoc支持的标签的扩展列表

Most links online that talk about XML Documentation in stop at

and the standard stuff.  Method documentation is interesting, but the real meat happens at the top of your Class declarations.  That's where most of the prose is in MSDN documentation.  Take a look at the Remarks section of the Socket Class in the MSDN Help for example. 

关于XML文档的大多数在线链接都以

和标准的开头。 方法文档很有趣,但真正的实质发生在类声明的顶部。 那是大多数散文在MSDN文档中的地方。 例如,请查看MSDN帮助中的Socket类的“备注”部分。

To achieve such a rich structure, organize your XML help thusly on the top of each class declaration:

为了实现这种丰富的结构,因此可以在每个声明的顶部组织XML帮助:

  • <摘要>
  • <备注>

    • (s)

      <注意>
  • (s)

    <示例>

    • <代码>
  • (s)

    <另请参阅>

The XML Comment snippet below, along with NDoc produced the lovely MSDN-style documentation in the picture at right.

下方的XML Comment片段与NDoc一起在右图中生成了可爱的MSDN样式的文档。

The

tag explains the “point” of the class. A sentence or two is fine here./// /// Encapsulates Thingie and a Connection to Thingie in a Service wrapper. /// Other Services will be built with this building block. /// The tag is where the real prose goes. Use this tag to describe the general use of the class, as well as any notes, gotchas, or significant design or architectural issues. Note the use of to separate paragraphs. Use to refer to namespaces, classes or methods. If you don’t include the fully qualified namespace, the documenter will assume the current namespace. /// <remarks>/// <para>The ThingieService class contains a <see cref&#61;"IConnector"/>/// that is pulled from the named element in the config/ThingieClient.config file. The config file/// is loaded by .para>/// <para>Note that the constructor is private, as your application gets a ThingieService by calling the static <see cref&#61;"GetThingieService"/> method. /// From there, the ThingieService hides the <see cref&#61;"IConnector"/> and/// is the primary interface to Thingie. The ThingieService shouldn&#39;t be used directly from an ASP.NET/// page. Instead, it should be used from either a generated or hand-written proxy.para>/// <note type&#61;"note">ASP.NET developers should use <see cref&#61;"Corillian.Thingie.Security.SiteSecureThing"/> to property register a <see cref&#61;"ThingiePrincipal"/> with the system to effectively use the ThingieService.note>/// <para>There are two ways to call the <see cref&#61;"Execute"/> method.para>/// <list type&#61;"bullet">/// <item>Pass in an object that implements <see cref&#61;"IRequest"/>. /// The Thingie SessionID and UserID will be retrieved from the on the current Thread.term>item>/// <item><term>Pass in an object that implements <see cref&#61;"IRequest"/> along with the Thingie SessionID and UserID as additional parameters. /// Use this method if your Thread doesn&#39;t already have a ThingiePrincipal. One will be made for you temporarily./// list>/// remarks>/// <example>/// <code>/// public class BankingExample/// {/// protected ThingieService thingie &#61; null;/// /// public BankingExample()/// {/// thingie &#61; ThingieService.GetThingieService("BankingServiceProxy");/// }/// /// public virtual SignonResponse Signon(SignonRequest req, string userId, string somethingElse ) /// {/// string sessionid &#61; thingie.SomethingImportantToTheSession(userId); /// string r &#61; thingie.Execute(req, sessionid, userId);/// SignonResponse retVal &#61; SignonResponse.FixUpSomething(r);/// return retVal;/// }/// }/// code>/// example>/// /// /// /// public class ThingieService....

标记解释了类的“要点”。 这里一两句话就可以了。 /// ///在服务包装器中封装Thingie和与Thingie的连接。 ///其他服务将使用此构建块构建。 /// 标签是真正的散文去处。 使用此标记来描述类的常规用法以及任何注释&#xff0c;陷阱或重大的设计或体系结构问题。 注意使用分隔段落。 使用来引用名称空间&#xff0c;类或方法。 如果您不包括完全限定的名称空间&#xff0c;则记录器将采用当前的名称空间。 /// <备注> /// <para > ThingieService类包含一个<see cref &#61;“ IConnector” /> ///&#xff0c;它从config / ThingieClient.config文件中的命名元素中提取。 配置文件///由加载。para > /// <para >请注意&#xff0c;构造函数是私有的&#xff0c;因为您的应用程序通过调用静态<see cref &#61; “ GetThingieService” />方法。 ///从那里&#xff0c;ThingieService隐藏<请参阅cref &#61;“ IConnector” />&#xff0c;并且///是Thingie的主要接口。 不应直接在ASP.NET ///页面上使用ThingieService 。 而是应从生成的或手写的代理中使用它。para > /// <note type &#61;“ note”> ASP.NET开发人员应使用<请参阅cref &#61;“ Corillian.Thingie.Security.SiteSecureThing” />要向系统属性注册<请参阅cref &#61;“ ThingiePrincipal” />以有效使用ThingieService。note > /// <para >有两种方法可以调用<请参阅cref &#61;“ Execute” />方法。para > /// <list type &#61;“ bullet”> /// <item > 传入实现<的对象<请参见cref &#61;“ IRequest” />。 /// Thingie SessionID和UserID将从当前线程上的中检索。term > item > /// <item > <term >传递实现的对象<请参阅cref &#61;“ IRequest” />以及Thingie SessionID和UserID作为附加参数。 ///如果您的线程还没有ThingiePrincipal&#xff0c;请使用此方法。 /// list > /// 备注> /// <example > /// <code > /// public class BankingExample // / { ///受保护的ThingieService物品&#61; null; /// /// public BankingExample() /// { /// thingie &#61; ThingieService.GetThingieService(“ BankingServiceProxy”); ///} /// ///公共虚拟SignonResponse Signon(SignonRequest请求&#xff0c;字符串userId&#xff0c;字符串somethingElse) /// { ///字符串sessionid &#61; Thietie.SomethingImportantToTheSession(userId); ///字符串r &#61; something.Execute(req&#xff0c;sessionid&#xff0c;userId); /// SignonResponse retVal &#61; SignonResponse.FixUpSomething(r); ///返回retVal; ///} ///} /// code > /// example > /// /// /// /// 公共类ThingieService...。

I also like to use Lutz Roeder&#39;s .NET Documentor to write my XML Comments in.  It has a split-pane view and a nice right-click menu that let&#39;s me see what the documentation will look like AS I TYPE.

我还喜欢使用Lutz Roeder的.NET Documentor来编写我的XML注释。它具有一个拆分窗格视图和一个漂亮的右键菜单&#xff0c;让我看看文档的外观如何。

Considering that I&#39;d need to recompile the Application AND generate the MSDN documentation, this little tool is a big time saver.

考虑到我需要重新编译应用程序并生成MSDN文档&#xff0c;因此这个小工具可以节省大量时间。

翻译自: https://www.hanselman.com/blog/effective-xml-document-with-c-ndoc-lutzs-documentor-and-the-microsoft-html-help-workshop

ndoc2007



推荐阅读
  • 本文主要解析了Open judge C16H问题中涉及到的Magical Balls的快速幂和逆元算法,并给出了问题的解析和解决方法。详细介绍了问题的背景和规则,并给出了相应的算法解析和实现步骤。通过本文的解析,读者可以更好地理解和解决Open judge C16H问题中的Magical Balls部分。 ... [详细]
  • 本文讨论了一个数列求和问题,该数列按照一定规律生成。通过观察数列的规律,我们可以得出求解该问题的算法。具体算法为计算前n项i*f[i]的和,其中f[i]表示数列中有i个数字。根据参考的思路,我们可以将算法的时间复杂度控制在O(n),即计算到5e5即可满足1e9的要求。 ... [详细]
  • 本文由编程笔记小编整理,主要介绍了使用Junit和黄瓜进行自动化测试中步骤缺失的问题。文章首先介绍了使用cucumber和Junit创建Runner类的代码,然后详细说明了黄瓜功能中的步骤和Steps类的实现。本文对于需要使用Junit和黄瓜进行自动化测试的开发者具有一定的参考价值。摘要长度:187字。 ... [详细]
  • 本文内容为asp.net微信公众平台开发的目录汇总,包括数据库设计、多层架构框架搭建和入口实现、微信消息封装及反射赋值、关注事件、用户记录、回复文本消息、图文消息、服务搭建(接入)、自定义菜单等。同时提供了示例代码和相关的后台管理功能。内容涵盖了多个方面,适合综合运用。 ... [详细]
  • vue使用
    关键词: ... [详细]
  • VScode格式化文档换行或不换行的设置方法
    本文介绍了在VScode中设置格式化文档换行或不换行的方法,包括使用插件和修改settings.json文件的内容。详细步骤为:找到settings.json文件,将其中的代码替换为指定的代码。 ... [详细]
  • 本文介绍了数据库的存储结构及其重要性,强调了关系数据库范例中将逻辑存储与物理存储分开的必要性。通过逻辑结构和物理结构的分离,可以实现对物理存储的重新组织和数据库的迁移,而应用程序不会察觉到任何更改。文章还展示了Oracle数据库的逻辑结构和物理结构,并介绍了表空间的概念和作用。 ... [详细]
  • HDU 2372 El Dorado(DP)的最长上升子序列长度求解方法
    本文介绍了解决HDU 2372 El Dorado问题的一种动态规划方法,通过循环k的方式求解最长上升子序列的长度。具体实现过程包括初始化dp数组、读取数列、计算最长上升子序列长度等步骤。 ... [详细]
  • 本文介绍了C++中省略号类型和参数个数不确定函数参数的使用方法,并提供了一个范例。通过宏定义的方式,可以方便地处理不定参数的情况。文章中给出了具体的代码实现,并对代码进行了解释和说明。这对于需要处理不定参数的情况的程序员来说,是一个很有用的参考资料。 ... [详细]
  • 本文介绍了P1651题目的描述和要求,以及计算能搭建的塔的最大高度的方法。通过动态规划和状压技术,将问题转化为求解差值的问题,并定义了相应的状态。最终得出了计算最大高度的解法。 ... [详细]
  • 本文介绍了通过ABAP开发往外网发邮件的需求,并提供了配置和代码整理的资料。其中包括了配置SAP邮件服务器的步骤和ABAP写发送邮件代码的过程。通过RZ10配置参数和icm/server_port_1的设定,可以实现向Sap User和外部邮件发送邮件的功能。希望对需要的开发人员有帮助。摘要长度:184字。 ... [详细]
  • switch语句的一些用法及注意事项
    本文介绍了使用switch语句时的一些用法和注意事项,包括如何实现"fall through"、default语句的作用、在case语句中定义变量时可能出现的问题以及解决方法。同时也提到了C#严格控制switch分支不允许贯穿的规定。通过本文的介绍,读者可以更好地理解和使用switch语句。 ... [详细]
  • 3.223.28周学习总结中的贪心作业收获及困惑
    本文是对3.223.28周学习总结中的贪心作业进行总结,作者在解题过程中参考了他人的代码,但前提是要先理解题目并有解题思路。作者分享了自己在贪心作业中的收获,同时提到了一道让他困惑的题目,即input details部分引发的疑惑。 ... [详细]
  • Linux如何安装Mongodb的详细步骤和注意事项
    本文介绍了Linux如何安装Mongodb的详细步骤和注意事项,同时介绍了Mongodb的特点和优势。Mongodb是一个开源的数据库,适用于各种规模的企业和各类应用程序。它具有灵活的数据模式和高性能的数据读写操作,能够提高企业的敏捷性和可扩展性。文章还提供了Mongodb的下载安装包地址。 ... [详细]
  • Imtryingtofigureoutawaytogeneratetorrentfilesfromabucket,usingtheAWSSDKforGo.我正 ... [详细]
author-avatar
广药中山校区艺术团啦啦队
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有