But what if you do need a more advanced property, where the data is manipulated? How do I get back to the more explicit long-hand format of a property if I need it? At least in VS.NET 2008, after finishing the definition of the property and its type and pressing <enter> the template was generated for me, so how do I recreate this in VS.NET2010?
The answer is to type in 'prop' (without quotes) which will show an Intellisense menu of built in snippets including the needed 'Property' code (shown below):
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFCn_MRFjoDkGxiDQP0qBulI6SBATk_E5nq8Df8K0phCM048RfrtpCeGutsl4azc5wdd0Qga-aLqvS_e8ghTy3tTliJsMBTQlwMibU72obu-hO-kCv1EEE5j5ePOpkEMD9Sg9IZ0OoyLzk/s400/AutoProperties1.png)
Type in 'prop' and hit the tab key twice to produce the long-hand explicitly defined version of the Property. In fact even this is 1 up from VS.NET 2008 as it creates the backing variable right on top of the property. All you need to do is tab through the fields to modify the values as needed. The long-hand version of the property is displayed below:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0k6WixlMDj3mlGGYiUDV__ZWfWi_4-hglr5dTJPD8ayDtDxfOJ2hNOW-UAVUnpi6Gl7g1UHoVMJJ5656C3cZDmGA-h05vW_tXutMALDEblpYRi7Ke0RBC6AivqProvWmQe04T_aGWDM8g/s320/AutoProperties2.png)
0 comments:
Post a Comment