在Visual Studio 2008中创建自定义代码段
时间:2020-03-06 14:33:54 来源:igfitidea点击:
如标题所示,如何在Visual Studio 2008中创建自定义代码段?
解决方案
这是用于创建/编辑代码段的实用程序的链接。尽管链接中有分类,但它不仅仅适用于VB,还适用于更多语言。
http://msdn.microsoft.com/en-us/vbasic/bb973770.aspx
请在此处查看官方文章:
http://msdn.microsoft.com/en-us/library/ms165392.aspx
这也刚刚发布:http://codeplex.com/SnippetDesigner
The Snippet Designer is a plugin which enhances the Visual Studio IDE to allow a richer and more productive code snippet experience... Features A Snippet editor integrated inside of the IDE which supports C#, Visual Basic, JavaScript, HTML, XML and SQL Access it by opening any .snippet file or going to File -> New -> File -> Code Snippet File It uses the native Visual Studio code editor so that you can write the snippets in the same enviorment you write your code. It lets you easily mark replacements by a convenient right click menu. It displays properties of the snippet inside the Visual Studio properties window... A Snippet Explorer tool window to search snippets on your computer. It is located under View -> Other Windows -> Snippet Explorer This tool window contains a code preview window which lets to peek inside the snippet to see what it is without opening the file. Maintains an index of snippets on your computer for quick searching. Provides a quick way to find a code snippet to use, edit or delete...
MSDN链接很好,但有时我更喜欢简单的教程。
工具->代码段管理器
获取目录列表。选择(或者添加)我的代码片段。
代码片段本身必须创建为具有.snippet扩展名的单独文件。
这是有关使用和创建它们的教程:Visual Studio中的代码段