VS
=> 工具
=> 代码片段管理器
=> 下拉选择 语言
==> 导入
/添加
创建名为method.snippet
的文件,然后将其导入
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>method</Title>
<Shortcut>method</Shortcut>
<Description>方法的代码片段</Description>
<Author>Microsoft Corporation</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>name</ID>
<ToolTip>方法名</ToolTip>
<Default>MyMethod</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[public async Task $name$()
{
$selected$$end$
}]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
标签:异步,片段,代码,导入,方法,method
From: https://www.cnblogs.com/vsnb/p/16539013.html