C#快捷方式或简写的getter setter方法 [英] C# shortcut or shorthand getter setter

查看:457
本文介绍了C#快捷方式或简写的getter setter方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有C#创建getter和setter一小段路

Is there a short way to create the getter and setter in c#?

public string fname {get; set;} 

有手短,生成 {搞定;设置;}

推荐答案

雅型的道具并按下TAB? Visual Studio中有自动物业的片段。

yea type prop and press TAB. Visual Studio has a snippet for automatic property.

有关公共get和私人设置属性,可以使用 propg 并按下TAB键。

For property with public get and private set, you can use propg and press TAB.

有关完整的非自动属性,你可以使用 propfull 和按TAB键。

For complete non auto property you can use propfull and press TAB.

这篇关于C#快捷方式或简写的getter setter方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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