Reputation: 15239
Is there a way (tool, or something) that permits do not duplicate the same XML comments when inheriting/Overriding methods from the base classes?
Eg.:
/// <summary>
/// Represent a brand new object in .NET
/// </summary>
public class MyObject : Object
{
/// <summary>
/// Copy-Paste the same Xml comment
/// like in the base class is boring!
/// </summary>
/// <param name="obj">and params too!! ((</param>
/// <returns>this one too!!! (((</returns>
public override bool Equals(object obj)
{
return base.Equals(obj);
}
}
Upvotes: 2
Views: 152
Reputation: 13138
If you are looking for a tool, you can try GhostDoc extension for visual studio. It helps you pre-generating comments and can take comments from base class.
As the generated comment is a regular comment, IntelliSense supports it properly but it's not magically updated when the base comment is changed.
Upvotes: 4
Reputation: 1502376
I think you're looking for inheritdoc
:
/// <inheritdoc />
public override bool Equals(object obj)
This is not a standard tag (so Intellisense may not support it, for exampple), but it's pretty commonly used - in particular, Sandcastle supports it.
Upvotes: 7