胶水程序员

导航

 

最近发现个代码管理器,对代码的复用有一定好处

vs本身就带有代码管理器(ctrl+k+b) 里面有各个代码块的包 地址(\Microsoft Visual Studio 10.0\VC#\Snippets\2052\Visual C#)

下面是我们经常使用的代码块prop

prop +tab键输出

 public int MyProperty { get; set; }

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
	<CodeSnippet Format="1.0.0">
		<Header>
			<Title>prop</Title> 
			<Shortcut>prop</Shortcut>
			<Description>自动实现的属性的代码段
语言版本: C# 3.0 或更高版本</Description>
			<Author>Microsoft Corporation</Author>
			<SnippetTypes>
				<SnippetType>Expansion</SnippetType>
			</SnippetTypes>
		</Header>
		<Snippet>
			<Declarations>
				<Literal>
					<ID>type</ID>
					<ToolTip>属性类型</ToolTip>
					<Default>int</Default>
				</Literal>
				<Literal>
					<ID>property</ID>
					<ToolTip>属性名</ToolTip>
					<Default>MyProperty</Default>
				</Literal>
			</Declarations>
			<Code Language="csharp"><![CDATA[public $type$ $property$ { get; set; }$end$]]>
			</Code>
		</Snippet>
	</CodeSnippet>
</CodeSnippets>

  代码块编辑工具SnippetEditor下载地址http://download.csdn.net/detail/ni_sheng/4576310

posted on 2012-09-17 22:01  胶水程序员  阅读(155)  评论(0)    收藏  举报