标签: xml-comments

Visual Studio禁用缺少XML注释警告

我有一个超过500个Missing XML Comment警告的项目.我知道我可以删除XML注释功能,或者在任何地方粘贴空注释片段,但我更喜欢通用的解决方案,我可以进行一次更改,禁用此类型的所有警告.

我现在所做的就是投入

///<Summary>
/// 
///</Summary>
Run Code Online (Sandbox Code Playgroud)

要么

#pragma warning disable 1591
Run Code Online (Sandbox Code Playgroud)

如果可能的话,只是好奇.

visual-studio-2010 xml-comments

183
推荐指数
5
解决办法
8万
查看次数

如何在IntelliSense中为Visual Studio中的函数添加注释?

在Visual Studio和C#中,当使用内置函数(如ToString())时,IntelliSense会显示一个黄色框,说明它的作用.

替代文字 替代文字

对于我编写的函数和属性,我怎么能拥有它?

c# vb.net xml-comments visual-studio-2008 visual-studio

132
推荐指数
8
解决办法
12万
查看次数

如何在XML中注释单行?

这是一个不容错过的验证.

XML中是否存在行注释?所以,没有更接近的,就像编译器使用的"//".

我看到如何在XML中注释掉一个标签块?和其他几个讨论.

这种类型的评论可以用来评论一条线而不会在某处向某处打扰.

xml xml-comments

117
推荐指数
5
解决办法
38万
查看次数

如何在XML标记内注释属性?

是否可以在XML标记内注释一个或多个属性?/* */来自C的东西

我尝试过使用<!-- -->,但没有成功.

<element
    attribute1="value1"
    attribute2="value2"
    <!-- attribute3="value3" (commented value) -->
>
Run Code Online (Sandbox Code Playgroud)

xml comments xml-attribute xml-comments

53
推荐指数
4
解决办法
2万
查看次数

C#XML ///注释,<returns> </ returns>标签出现在哪里?

我目前是一名编程学生,显然我的问题很简单,但我无法在网上找到答案.所以这里是:

在XML /// C#中的注释中,<returns>标签出现在哪里,我知道<summary>当你将鼠标悬停在方法调用上而不是返回标记时,标记中包含的所有内容都会显示在intellisense中.

那么<returns>标签在哪里?

谢谢.

c# xml-comments

45
推荐指数
4
解决办法
1万
查看次数

Visual Studio代码中的XML自动注释C#

在MonoDevelop中,当我输入"///"时,它会自动生成一个xml风格的注释,如下所示:

/// <summary>
/// Describes the variable x
/// </summary>
int x = 0;
Run Code Online (Sandbox Code Playgroud)

有没有办法在Visual Studio代码中获得此行为?

c# xml-comments visual-studio-code

29
推荐指数
3
解决办法
1万
查看次数

XML注释中的filterpriority标记有什么作用?

我已经在.NET Framework BCL中的类的许多XML注释中看到了这一点,但是从来没有找到解释它的功能的文档.

例如,查看System.Object会显示以下注释:

namespace System   
{
    /// <summary>Supports all classes in the .NET Framework class hierarchy 
    /// and provides low-level services to derived classes. This is the 
    /// ultimate base class of all classes in the .NET Framework; it is the
    /// root of the type hierarchy.</summary>
    /// <filterpriority>1</filterpriority> 
    [System.Runtime.InteropServices.ClassInterfaceAttribute(2)]
    public class Object    
    {    
        /// <summary>Determines whether the specified 
        /// <see cref="T:System.Object" /> 
        /// instances are considered equal.</summary>  
        /// <returns>true if objA is the same instance as objB or …
Run Code Online (Sandbox Code Playgroud)

.net xml-comments

28
推荐指数
2
解决办法
2618
查看次数

ConfigurationManager可以在Save()上保留XML注释吗?

我写了一个小实用程序,允许我为另一个应用程序的App.config文件更改一个简单的AppSetting,然后保存更改:

 //save a backup copy first.
 var cfg = ConfigurationManager.OpenExeConfiguration(pathToExeFile);
 cfg.SaveAs(cfg.FilePath + "." + DateTime.Now.ToFileTime() + ".bak"); 

 //reopen the original config again and update it.
 cfg = ConfigurationManager.OpenExeConfiguration(pathToExeFile);
 var setting = cfg.AppSettings.Settings[keyName];
 setting.Value = newValue;

 //save the changed configuration.
 cfg.Save(ConfigurationSaveMode.Full); 
Run Code Online (Sandbox Code Playgroud)

这种效果很好,除了一个副作用.新保存的.config文件丢失所有原始XML注释,但仅在AppSettings区域内.是否可以从原始配置文件AppSettings区域保留XML注释?

如果您想快速编译并运行它,那么这是完整源代码的pastebin.

c# xml configurationmanager configuration-files xml-comments

26
推荐指数
2
解决办法
3672
查看次数

C#中的XML多行注释 - 我做错了什么?

根据这篇文章,可以获得多行XML注释 - 而不是使用///,使用/** */.这是我对多行注释的解释,以及我想要发生的事情:

/**
 * <summary>
 * this comment is on line 1 in the tooltip
 * this comment is on line 2 in the tooltip
 * </summary>
 */
Run Code Online (Sandbox Code Playgroud)

但是,当我使用这个表单时,当我将鼠标悬停在我的代码中时弹出的工具提示是单行的,即它看起来就像我写了这样的评论:

/// <summary>
/// this comment is on line 1 in the tooltip
/// this comment is on line 2 in the tooltip
/// </summary>
Run Code Online (Sandbox Code Playgroud)

这种行为实际上是否仍然可以在VS2008中使用?

编辑

gabe指出我误解了"多线"意味着什么,我实际上需要使用<para><br>获得我想要的效果.我继续使用,<br>因为我想控制断线发生的位置,即

/// <summary>
/// this comment is on line 1 in …
Run Code Online (Sandbox Code Playgroud)

c# comments multiline xml-comments visual-studio-2008

26
推荐指数
2
解决办法
1万
查看次数

XML注释 - 应该看到引用完全合格吗?

基本上,何时真正需要(如果有的话)使用完全限定的xml参见参考:

<see cref="T:MyNamespace.Sub.MyType"/> //Option 1
<see cref="T:MyType"> //Option 2
Run Code Online (Sandbox Code Playgroud)

另外,引用.NET Framework对象怎么样?

<see cref="T:System.Collections.Generic.ICollection{T}"/> //Option 1
<see cref="T:ICollection{T}"/> //Option 2
Run Code Online (Sandbox Code Playgroud)

我知道完全符合条件的项目将始终允许Microsoft的Sandcastle正确地链接事物,但是一切都必须完全合格吗?


旁注:Microsoft Sandcastle是否能够链接到.NET Framework帮助文件,还是我通过引用浪费时间<see cref="T:System.Collections.Generic.ICollection{T}"/>

c# sandcastle xml-comments fully-qualified-naming

24
推荐指数
1
解决办法
4516
查看次数