joh*_*ohn 124 c# xml hyperlink
是否可以在XML文档中包含指向网站的链接?例如,我的方法总结为
///<Summary>
/// This is a math function I found HERE.
///</Summary>
public void SomeMathThing(Double[] doubleArray)
{
   ...
}
当我打字的时候
SomeMathThing(
我希望IntelliSense显示摘要,并选择单击"此处"链接到外部网站.这可能吗?怎么做?
diz*_*ave 124
尝试:
///<Summary>
/// This is a math function I found <see href="http://stackoverflow.com">HERE</see>
///</Summary>
MHo*_*ayr 64
炒作有点晚了,但这是我在Visual Studio 2015中发现的.
我的示例如下所示:
    /// <summary>
    ///     Retrieves information about the specified window. 
    ///     The function also retrieves the value at a specified offset into the extra window memory.
    ///     From <see cref="!:https://msdn.microsoft.com/en-us/library/windows/desktop/ms633585(v=vs.85).aspx">this</see> MSDN-Link.
    ///     AHref <a href="http://stackoverflow.com">here</a>.
    ///     see-href <see href="http://stackoverflow.com">here</see>.
    /// </summary>
    /// <param name="hwnd"></param>
    /// <param name="index"></param>
    /// <returns>
    ///     Testlink in return: <a href="http://stackoverflow.com">here</a>
    /// </returns>
    public static IntPtr GetWindowLongPtr(IntPtr hwnd, int index)
    {
        return IntPtr.Size == 4 ? GetWindowLongPtr32(hwnd, index) : GetWindowLongPtr64(hwnd, index);
    }
结果是:
结论:正如海纳指出的那样,最好的一个就是
See <a href="link">this link</a> for more information.
更新 正如ThomasHagström指出的那样,Resharper现在支持可点击的a-href网址.相应更新截图.
Hei*_*ner 21
您可以使用标准HTML语法:
<a href="http://stackoverflow.com">here</a>
该文本将显示在Visual Studio中.
fub*_*aar 18
你可以在cref中包含一个!:前缀,使其在生成的Xml文档中不受影响,以便像Innovasys Document这样的工具!X和Sandcastle将使用它.例如
/// <summary>
/// This is a math function I found <see cref="!:http://stackoverflow.com">HERE</see>
/// </summary>
Visual Studio intellisense不会将其显示为intellisense的链接 - 因为它是工具提示所以不会有太大的意义,因此无论如何都无法点击它.
Ram*_*yev 11
使用<a>标签。例如,我在我的项目中使用了这个解决方案:
结果:
我的 XML 代码:
/// <summary>
/// This is C# XML Documentation Website Link
/// <a href="/sf/ask/487229851/">See more</a>
/// </summary>
或者使用<see>标签。结果与<a>标签相同。
/// <summary>
/// This is C# XML Documentation Website Link
/// <see href="/sf/ask/487229851/">See more</see>
/// </summary>
| 归档时间: | 
 | 
| 查看次数: | 32907 次 | 
| 最近记录: |