I am writing a macro for Visual studio that will generate some code.
I would like for the macro to generate for both C# and VB, is there a way to determine what language is being used in the active (current) document?
I am writing a macro for Visual studio that will generate some code.
I would like for the macro to generate for both C# and VB, is there a way to determine what language is being used in the active (current) document?
Have you considered using T4?
T4 is a code generator built right into Visual Studio. If you're using C#, you'll have a sub .cs file, or if you're using VB, a sub .vb file. That's the file that will hold the result of the generation. This is the same visual metaphor used to the express the template/generated file relationship with .designer files you've seen elsewhere in Visual Studio.
I just located a bit of code, it seems that it's a hidden property:
DTE.ActiveDocument.Language = "CSharp"