Visual Studio.Net – Create Property Macro for C#


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

Download:

Download ReflectionITMacro.zip

Requirements:

Microsoft Visual Studio.NET beta 2

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…'

img0 Visual Studio.Net   Create Property Macro for C#

5. Select the (unzipped) 'ReflectionIT.vsmacros' file and select 'Open'.

6. Open a CodeWindow and enter the Datatype and the Property you want to add.

Example:

img3 Visual Studio.Net   Create Property Macro for C#

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

img1 Visual Studio.Net   Create Property Macro for C#

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

img2 Visual Studio.Net   Create Property Macro for C#

Most Commented Articles :

Twitter Digg Delicious Stumbleupon Technorati Facebook Email

No comments yet... Be the first to leave a reply!