Http://blog.sina.com.cn/s/blog_62ff35cc010190wi.html
Today found a very useful shortcut built, ctrl+r,ctrl+e These two key combinations, you can automatically generate the properties of the get and set methods.
Unlike the Java syntax, there are both field and properity in. NET, in addition to the Get/set method.
field is a private field, used internally, to have a bottom line before the variable name. Properity is a public property that is externally visible, with no line drawn before the variable name.
Of course, you can also use the mouse to select a field variable without a shortcut key, and then right-click Refactor (Refactor) and encapuslate field (encapsulate fields). The effect is as follows: #region field
02Privateint_levelid;
03Privatestring_levelname;
#endregion
05
Properity #region
07 Public intLevelid
08 {
09 Get{ return_levelid; }
10Set{_levelid =value; }
11}
12 PublicstringLevelName
13 {
14 Get{ return_levelname; }
15Set{_levelname =value; }
16}
#endregion
The better thing is to just type in the prop and then press TAB twice. The get/set is automatically generated. You only need to modify the property name.