VS xml文档,继承自基类
我已启用在我的类库上生成 XML 文档,该类库有一个父类和许多从中继承的类。有几个属性是从基类属性中重写的。我想在基类属性上添加 XML 注释,并在覆盖的属性上获得相同的注释。不幸的是,当我生成 XML 文档文件时,重写的属性上缺少注释。是否可以覆盖基类的 xml 注释?
I have enabled generating XML documentation on my class library which has one parent class and many inherited classes from it. There are several properties overridden from base class properties. I would like to put XML comments on base class properties and get the same comments on overridden properties. Unfortunately when I generate XML Doc file the comments are missing on overridden properties. Is it possible to override xml comments from base class?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您用来生成外部文档的工具(Doxygen、Sandcastle 等),您可以使用
include
或类似元素从其他地方提取文档,以便进行共享。另一种方法是使用
see
、seealso
或sa
条目(同样,取决于您处理文档注释的工具)来引用基础类属性/方法,但这意味着指向基本条目的超链接,而不是内联文档。第三种可能性是我的插件,AtomineerUtils。 (除其他外)它将把文档从基类/接口复制到您的覆盖/实现中,因此复制文档只需要一点时间。然后,您可以修改复制的文档,使其更具体地针对其所附加的特定方法。
Depending on the tools you use to generate the external documentation (Doxygen, Sandcastle, etc) you may be able to use an
include
or similar element to pull in documentation from elsewhere so it can be shared.Another approach is to use
see
,seealso
orsa
entries (again, depending on the tool you process the documentation comments with) to reference the base class property/method, but this will mean a hyperlink to the base entry, not inlined documentation.A third possibiility is my addin, AtomineerUtils. (Among other things) it will duplicate the documentation from the base class/interface up into your override/implementation, so it only takes a moment to copy the documentation. You can then modify the copied documentation to be more specific to the particular method it is attached to.