In Visual Studio 2010 is there a way to get Intellisense on the Interface that a method implements if that method does not have any XML comments of its own?
I suppose something like this would be fairly useful. I like to include XML comments with the interface and don't like to repeat (copy) the same text at every implementing method. Only when something specific to the implementing method needs to be described, I give the method its own XML comments.
C# documentation comments use XML elements to define the structure of the output documentation. One consequence of this feature is that you can add any valid XML in your documentation comments. The C# compiler copies these elements into the output XML file.
The IntelliSense completion lists in C# contain tokens from List Members, Complete Word, and more. It provides quick access to: Members of a type or namespace. Variables, commands, and functions names. Code snippets.
If you have ReSharper you can just use Ctrl+Shift+F1 to show the short help of method. If that method does not have any XML comments the help of its interface is shown. I do not have enough reputation to give you a screenshot. So I show you my code and explain it:
internal interface ISomeInterface
{
/// <summary>
/// Integer1 help text by interface.
/// </summary>
int Integer1 { get; set; }
}
internal class Class2 : ISomeInterface
{
public int Integer1 { get; set; }
public int CallInterface1( )
{
return Integer1; // <- Place cursor on Integer1 and press Ctrl+Shift+F1
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With