Discover the code documentation at runtime by reflection.
Original source code from Jim Blackler' DocsByReflection: http://jimblackler.net/blog/?p=49
PM> Install-Package DocsByReflection
// From type.
var typeDoc = DocsService.GetXmlFromType(typeof(Stub));
// From property.
var propertyInfo = typeof(Stub).GetProperty("PropertyWithDoc");
var propertyDoc = DocsService.GetXmlFromMember(propertyInfo);
// From method.
var methodInfo = typeof(Stub).GetMethod("MethodWithGenericParameter");
var methodDoc = DocsService.GetXmlFromMember(methodInfo);
// From assembly.
var assemblyDoc = DocsService.GetXmlFromAssembly(typeof(Stub).Assembly);
All of the above methods have a last parameter called throwError. The default parameter's value is true, when value is true any documentation not found will throw an error, when value is false the method will return a null value.
DocsByReflection is release using a dual-license. You can choose the one that best fit your needs: