[一个不错的工具推荐] 提高开发效率 之 代码段 使用
代码段是微软提供的众多帮助开发的功能之一,非常方便,将我们复用的代码都写成代码段,用到时候敲几个简单的缩写或简写就可以了。
比如你添加构造函数,类中输入ctor,按下tab,就自动的会生成构造函数。
方法中输入mbox,按Tab,就会生成MessageBox.Show("");
还有很多,你可以在D:\Program Files\Microsoft Visual Studio 9.0\VC#\Snippets\2052\Visual C#目录下找找,或是在代码段编辑器中,选择c#,看到所支持的代码段。
言归正传,我们自己能不能创建代码段呢?可以,微软已经给我们方法了,Creating Code Snippets。自己创建xml文件,自己编写每个节点。
有没有更简单的方法?有。
Snippet Designer
Creating A Snippet From Scratch in VS 2010
The following describes how to create a new snippet file from scratch using the Snippet Designer
Open up the new file dialog

Select the Code Snippet

This will open up a blank snippet editor

Enter the code which you would like to become your snippet

Right click on the variables/symbols you would like to be replacements and choose make replacement

Afterwards you will see this

Repeat this process for all variables/symbols you would like to be replacements

Set your snippet's name and set the shortcut with which you would like to access your snippet

Then Save your snippet and you are done!!

下载地址:
SnippetDesignerFor2008
SnippetDesignerFor2010
比如你添加构造函数,类中输入ctor,按下tab,就自动的会生成构造函数。
方法中输入mbox,按Tab,就会生成MessageBox.Show("");
还有很多,你可以在D:\Program Files\Microsoft Visual Studio 9.0\VC#\Snippets\2052\Visual C#目录下找找,或是在代码段编辑器中,选择c#,看到所支持的代码段。
言归正传,我们自己能不能创建代码段呢?可以,微软已经给我们方法了,Creating Code Snippets。自己创建xml文件,自己编写每个节点。
有没有更简单的方法?有。
Snippet Designer
Creating A Snippet From Scratch in VS 2010
The following describes how to create a new snippet file from scratch using the Snippet Designer
Open up the new file dialog
Select the Code Snippet
This will open up a blank snippet editor
Enter the code which you would like to become your snippet
Right click on the variables/symbols you would like to be replacements and choose make replacement
Afterwards you will see this
Repeat this process for all variables/symbols you would like to be replacements
Set your snippet's name and set the shortcut with which you would like to access your snippet
Then Save your snippet and you are done!!
下载地址:
SnippetDesignerFor2008
SnippetDesignerFor2010
...全文
相关推荐
IDEA提高开发效率的7个插件(推荐)
主要介绍了IDEA提高开发效率的7个插件(推荐),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
用C#代码段,提高工作效率(C# code snippet)
C# 使用代码段管理,提高开发效率 添加代码段后,在coding代码的时候,只需写代码段的名字,然后按两次“Tab”键,完整的代码就出来了。
使用WEB工具快速提高Android开发效率
正所谓工欲善其事,必先利其器。学习并应用优秀的轮子,可以让我们跑的更快,走的更远。这里所指的工具是广义的,泛指能帮助我们开发的东西,或者能提高我们效率的东西,包括:开发工具,监测工具,第三方代码库等
VSCode提高 Node 和 Vue 开发效率的插件推荐
工欲善其事必先利其器,以下是本人为Node 和 Vue开发收集的vscode插件,有需要的话赶紧mark起来吧~
c#代码段编辑器,非常方便的使用工具
很多代码你是不是已经打烦了? 如果有一个东西可以把经常用的代码就想平时用if一样Tab打出来就好了. 对这就是你需要的。


非技术区
