I've asked this question on three different forums and no one can figure it out. I'm trying to write a macro in VS2010 that will copy some code around. So, given this setup:
public class foo {
//[source1]
public overrides string ToString() {
return "Hello from Foo"
}
//[/source1]
}
public class bar {
//[destination1]
//[/destination1]
}
...the objective is to click the macro and have the code copied to bar, so that it overrides ToString() also. I have a semi-working version
DTE.Find.FindWhat = "(//\[source1\]{(.|\n)*})//\[/source1\])|//\[destination1\]{(.|\n)*}//\[/destination1\]"
DTE.Find.Target = vsFindTarget.vsFindTargetSolution
DTE.Find.MatchCase = False
DTE.Find.MatchInHiddenText = True
DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxRegExpr
DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResultsNone
DTE.Find.Action = vsFindAction.vsFindActionReplaceAll
...except that it's completely useless if the classes are in different files. I can't capture the actual matches that are found; I can output them to vsFindResults1, except that I can't select the window text with a macro. I can click it, Ctrl-A -> Ctrl-C and capture it, but when I do this recording a macro it shows nothing!! Very frustrated....any ideas?