开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜