Create Property Macro for VS.NET 2002 & 2003

By Fons Sonnemans, posted on
1454 Views

The CreateProperty macro is simple Visual Studio.Net (Final) macro which can be used to generate the code for a 'private Field and a public Property Get/Set method'.

Example:

1. Unzip the ReflectionIT macro.zip
 
2.  Start Visual Studio.Net.
 
3.  Open the Macro Explorer (Alt-F8)
 
4.  Right-click on the Macros, and select 'Load Macro Project...'
 
 
5.  Select the (unzipped) 'ReflectionIT.vsmacros' file and select 'Open'. 
6. Open a CodeWindow and add a public, private or protected field.

Example:

   
7. Select the text you just have entered and run the 'CreateProperty' macro

   
8. Your text is automatically replaced by a private field and an public property

   

Any suggestions and feedback for improving this article is most welcome. Send your suggestions and feedback to Fons.Sonnemans@reflectionit.nl

Download

All postings/content on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer or sponsors. The content on this site is licensed under a Creative Commons Attribution By license.

Leave a comment

Blog comments

0 responses