Programmatically retrieve function header information
I have a function GetMainWindowAE, which contains the header information as shown below.
/// <summary>
/// Gets the main window automation element.
/// </summary>开发者_开发技巧;
/// <returns></returns>
public static AutomationElement GetMainWindowAE()
{
//Return automation element using window handle of that process
return AutomationElement.FromHandle(AppContext.ActiveApplication.Process.MainWindowHandle);
}
How can I programmatically get the data which is in header with comments using .net?
You can use Reflection to achieve this. The MethodInfo property of the method contains the XML comments associated with the method (AKA the header information).
See this blog entry for more information and code example.
精彩评论