XML comments - How do you properly comment on explicitly implemented interfaces?

The code:

public interface IFoo
{
    void Bar();
}

public class FooClass : IFoo
{
    /// <summary> ... </summary>
    /// <seealso cref="?"/> //How do you reference the IFoo.Bar() method
    public void Bar() { }

    /// <summary> ... </summary>
    /// <seealso cref="?"/> //How do you reference the standard Bar() method
    void IFoo.Bar() { }
}

My suggestion:

<seealso cref="IFoo.Bar()"/> //Explicitly implemented interface method
<seealso cref="Bar()"/>      //Standard method

but I'm not sure. ECMA management did not help to distinguish, so I think I'm looking for confidence that my guess is correct.

+5
source share
1 answer

A quick test using the Sandcastle Help File Builder showed that in the generated documentation, the link <seealso cref="IFoo.Bar()"/>points to a method in the interface and <seealso cref="Bar()"/>points to a method in the class. The documentation for an explicitly implemented method is inherited from the interface, so in any case, you should actually point to the interface method.

: ReSharper <seealso cref="FooClass.IFoo.Bar()"/> <seealso cref="IFoo.Bar()"/>, , .

+1

All Articles