扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:廖煜嵘编译 来源:天极开发 2007年11月3日
关键字:
<?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>Code snippet for property and backing field</Description> <Author>Microsoft Corporation</Author> <SnippetTypes> <SnippetType>Expansion</SnippetType> </SnippetTypes> </Header> <Snippet> <Declarations> <Literal> <ID>type</ID> <ToolTip>Property type</ToolTip> <Default>int</Default> </Literal> <Literal> <ID>property</ID> <ToolTip>Property name</ToolTip> <Default>MyProperty</Default> </Literal> <Literal> <ID>field</ID> <ToolTip>The variable backing this property</ToolTip> <Default>myVar</Default> </Literal> </Declarations> <Code Language="csharp"><![CDATA[private $type$ $field$; public $type$ $property$ { get { return $field$;} set { $field$ = value;} } $end$]]> </Code> </Snippet> </CodeSnippet> </CodeSnippets> |
Private $PrivateVariable$ As $PropertyType$ Public Property $PropertyName$() As $PropertyType$ Get If $PrivateVariable$ Is Nothing Then $PrivateVariable$ = New $PropertyType$ End If Return $PrivateVariable$ End Get Set(ByVal value As $PropertyType$) $PrivateVariable$ = value End Set End Property |
Private abc As User Public Property setUser() As User Get If abc Is Nothing Then abc = New User End If Return abc End Get Set(ByVal value As String) abc = value End Set End Property |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者