- 类型:编程辅助大小:2.7M语言:中文 评分:1.8
- 标签:
ADB2.3使用指南
ADB2.3使用方法如下图所示:
(1)主界面:
(2)批量选择:
4.生成的文档
(1)命名空间页面:
2.类型页面:
3.成员页面:
5.开发自定义文档生成器
ADB2.3支持加载用户自定义的文档生成器,用户可根据自己的需求开发文档生成器,下面以开发自定义文档生成器MyBuilder为例,说明如何开发自定义文档生成器:
⑴目标:
开发一个自定义文档生成器,该文档生成器在ADB默认文档生成器基础上扩展以下功能:
a.在XML文档注释可以用插入图片;
b.在类型页面和成员页面中增加一个名称为“自定义节”的内容节。
⑵开发步骤
a.点击菜单 工具->生成自定义文档解决方案->扩展XML文档注释,在弹出的对话框中输入文档生成器名称
b.打开工程中的MyBuilder.cs文件,输入以下代码
using System; using System.Collections.Generic; using System.Text; using ADB.Factories; using Microsoft.VisualBasic.FileIO; namespace CustomBuilder { /// /// MyBuilder /// public class MyBuilder : ADB.Factories.MSDNStyleCHMDocumentBuilder { static PageSection[] _memberPageSections, _typePageSections; public MyBuilder(IGetData data, IInteract interact) : base(data, interact) { //base.MemberPageSections为页面原有的节,将自定义节插入到页面的最后 _memberPageSections = new PageSection[base.MemberPageSections.Length + 1]; base.MemberPageSections.CopyTo(_memberPageSections, 0); _memberPageSections[base.MemberPageSections.Length] = new PageSection("自定义节", PageSectionType.FromXML, "CustomSection"); //base.MemberPageSections为页面原有的节,将自定义节插入到页面的最后 _typePageSections = new PageSection[base.TypePageSections.Length + 1]; base.TypePageSections.CopyTo(_typePageSections, 0); _typePageSections[base.TypePageSections.Length] = new PageSection("自定义节", PageSectionType.FromXML, "CustomSection"); } //重写基类的MemberPageSections属性 public override PageSection[] MemberPageSections { get { return _memberPageSections; } } //重写基类的TypePageSections属性 public override PageSection[] TypePageSections { get { return _typePageSections; } } protected override string GetTag(System.Xml.XmlElement elem, string xmlFile) { switch (elem.Name) { case "CustomSection": { //生成"自定义节"的内容 return GetInnerTags(elem, xmlFile); } case "image": { StringBuilder tag = new StringBuilder(); string src = elem.GetAttribute("src"); if (!string.IsNullOrEmpty(src)) { try { //将图片拷贝到生成页面的目录中 //(通过属性HtmlFileDirectory获取保存页面的目录) FileSystem.CopyFile( xmlFile + "\\" + src, HtmlFileDirectory + "\\" + src, true ); } finally { } //生成HTML标志 tag.AppendFormat("<img src='{0}'/>", src); } return tag.ToString(); } default: { //其它标志由基类处理 return base.GetTag(elem, xmlFile); } } } } }
c.点击调试按钮调试自定义文档生成器
⑶测试
由于测试的类及其XML注释:
namespace ClassLibrary1 { /// /// Class摘要 /// /// /// 自定义的节 ///
<image src="1.gif"/>
/// public class Class1 { }}
用自定义文档生成器MyBuilder生成的文档
⑷让ADB启动时自动加载文档生成器
在ADB目录下新建目录MyBuilder,并将MyBuilder.dll和MyBuilder.builder拷贝到该文件夹中
ADB2.3支持的注释标记
本博客Android APP 下载 |
![]() |
支持我们就给我们点打赏 |
![]() |
支付宝打赏 支付宝扫一扫二维码 |
![]() |
微信打赏 微信扫一扫二维码 |
![]() |
如果想下次快速找到我,记得点下面的关注哦!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!