views:

51

answers:

3

I constantly have to write classes in C# with properties that have backing fields so I can implement custom logic (e.g. if (m_x < 5) { // do something here }. I also constantly code events and their handlers quite often. This is all routine coding which everyone does daily and doesn't really think about.

However, it is quite a drain on productivity as I spend so much time on this rather than the actual business logic. Is there a way I can automate all of this (e.g. through a wizard perhaps)?

I am using Visual Studio 2008 Professional Edition.

Thanks

A: 

I think this is what you're describing.

WebDevHobo
+3  A: 

There are snippets - a part of Visual Studio, or you could even use Live Templates if you have ReSharper installed (you should have :)

Per Hornshøj-Schierbeck
A: 

Macros or code snippets are a good solution to this repetition.

HTH, Kent

Kent Boogaart