Search Forum
(57415 Postings)
Search Site/Articles

Archived Articles
712 Articles

C# Books
C# Consultants
What Is C#?
Download Compiler
Code Archive
Archived Articles
Advertise
Contribute
C# Jobs
Beginners Tutorial
C# Contractors
C# Consulting
Links
C# Manual
Contact Us
Legal

GoDiagram for .NET from Northwoods Software www.nwoods.com


              
Printable Version

Visual Studio.Net - Create Property Macro for C#
By Fons Sonnemans

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

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:

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