快捷方式创建在Visual Studio中的属性? [英] Shortcut to create properties in Visual Studio?

查看:129
本文介绍了快捷方式创建在Visual Studio中的属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过一些人创造了C#性能非常快,但他们是如何mod呢?

什么快捷方式在Visual Studio中提供(目前使用Visual &工作室NBSP; 2010),以创建属性。

我使用C#。

例如,

 公共字符串的myString {获取;设置;}


解决方案

您可以键入托,然后preSS标签的两倍。将生成以下

  public类型类型{搞定;组; }

然后更改类型和类型:

 公共字符串的myString {搞定;组;}

您还可以得到完整的财产输入propfull,然后标签的两倍。这将产生领域和全属性。

 私人诠释myVar的;公众诠释myProperty的
{
    得到{myVar的;}
    集合{myVar的=值;}
}

I have seen some people creating properties in C# really fast, but how they dod it?

What shortcuts are available in Visual Studio (currently using Visual Studio 2010) to create properties?

I am using C#.

For example,

public string myString {get;set;}

解决方案

You could type "prop" and then press tab twice. That will generate the following.

public TYPE Type { get; set; }

Then you change "TYPE" and "Type":

public string myString {get; set;}

You can also get the full property typing "propfull" and then tab twice. That would generate the field and the full property.

private int myVar;

public int MyProperty
{
    get { return myVar;}
    set { myVar = value;}
}

这篇关于快捷方式创建在Visual Studio中的属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆