开发者

How to copy .NET API documentation?

If a class implements a method defined in an interface you can choose whether you duplicate the documentation or reference it with <see cref="..." />.

public interface IPerformer
{
    /// <summary>
    /// Do something useful.
    /// </summary>
    /// <param name="something">Object to do something with</param>
    void Do(Something something);
}

public class Implementation : IPerformer
{
    /// <copy from="IPerformer" /> # that is what I want!
    public void Do(Something something)
    {
        // implementation ...
    }
}

Is it possible to let the API documentation tool (Sandcastle) copy the documentation automatic开发者_如何学JAVAally (what would make reading the API documentation more comfortable)? Something like @inheritDoc from Java Doc?


Not quite the answer you're looking for, but GhostDoc can do this for you. It will pull the comments from the interface into the implementation.


Sandcastle Help File Builder (SHFB) provide this functionality through the inheritdoc tag.


Jetbrain's Resharper allows you to copy comments from interface (or when you create instance from interface, it will automatically copy them for you), but if you update the interface's comment, you will have to remove comments and copy comments from base again!


AtomineerUtils Pro Documentation will duplicate base class, interface and overload documentation for you automatically. (It's similar to GhostDoc, but it's a much more powerful and configurable documentation generator).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜