string GetDocumentationCommentXml(bool includeInheritDoc)
using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; IMethodSymbol methodSymbol = /* get method symbol */ string documentationCommentXml = methodSymbol.GetDocumentationCommentXml(); // do something with the documentation comment
using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; class MyBaseClass { ///This example demonstrates how to use the GetDocumentationCommentXml method to retrieve documentation comments for an overridden method. The comments are retrieved from the base method using the/// This is the base method /// public virtual void MyMethod() { } } class MyDerivedClass : MyBaseClass { ///public override void MyMethod() { } } IMethodSymbol methodSymbol = /* get overridden method symbol */ string documentationCommentXml = methodSymbol.GetDocumentationCommentXml(true); // do something with the documentation comment