开发者

Programmatically retrieve function header information

开发者 https://www.devze.com 2023-01-19 00:57 出处:网络
I have a function GetMainWindowAE, which contains the header information as shown below. /// <summary>

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

精彩评论

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