在Visual Studio中更改默认的XML注释片段

编程入门 行业动态 更新时间:2024-10-23 20:29:59
本文介绍了在Visual Studio中更改默认的XML注释片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我在Visual Studio中点击///时,是否可以从中更改结果片段:

When I hit /// in Visual Studio, is it possible to change the resulting snippet from this:

/// <summary> /// /// </summary>

对此吗?:

/// <summary></summary>

推荐答案

以下是至少在VS2010中有效的解决方案.

Here is the solution working in at least VS2010.

将底部代码另存为文件summ.snippet. Visual Studio 2010/工具/代码段管理器 单击导入,浏览到文件.使用默认选项保存.

Save the bottom code as a file summ.snippet. Visual Studio 2010 / Tools / Code Snippet Manager Click import, browse to file. Save with default options.

现在转到您的代码窗口并输入 摘要+标签+标签

Now goto your code window and type summ + tab + tab

结果

/// <summary> </summary>

将光标放在标签的中间,可以输入内容.

with the cursor in the middle of the tag, ready to type.

这是summ.snippet的内容

Here is the contents of the summ.snippet

<CodeSnippets xmlns="schemas.microsoft/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>Summary - inline</Title> <Description>Created inline summary comment tag</Description> <Author>Mike Vanderkley</Author> <Shortcut>summ</Shortcut> <SnippetTypes> <SnippetType>Expansion</SnippetType> </SnippetTypes> </Header> <Snippet> <Code Language="csharp"> <![CDATA[/// <summary> $end$ </summary>]]> </Code> </Snippet> </CodeSnippet> </CodeSnippets>

更多推荐

在Visual Studio中更改默认的XML注释片段

本文发布于:2023-11-13 00:55:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582966.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:注释   片段   Visual   Studio   XML

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!