This isn t exactly what you re looking for, but it might get you close to the result you need.
This is a Visual Studio 2008 Macro which will find the class diagram generated get properties and replace them with auto properties.
- In VS go to View -> Other Windows -> Macro Explorer
- Right click on "MyMacros" and select "New module..."
- Give it any name you d like
- Right click on that and select "New macro"
- Paste this code in
Here s the code:
DTE.ExecuteCommand("Edit.Find")
DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxRegExpr
DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.FindWhat = "<get$"
DTE.Find.MatchCase = False
DTE.Find.MatchWholeWord = False
DTE.Find.Backwards = False
DTE.Find.MatchInHiddenText = True
DTE.Find.Action = vsFindAction.vsFindActionFind
While DTE.Find.Execute() <> vsFindResult.vsFindResultNotFound
DTE.ActiveDocument.Selection.LineDown(True, 6)
DTE.ExecuteCommand("Edit.Delete")
DTE.ActiveDocument.Selection.Text = "get; set;"
End While
This is pretty much just a hack, and I m not sure if it will work with all the output from the class designer, but it has worked in my testing so far and it certainly saves a few keystrokes.
Hope it helps!