I need to construct a Visual Studio project template that has a certain amount of intelligence. I've discovered a way to get Visual Studio to call my custom code upon creation of a new project from my template, the custom code displays a dialog box and gathers information from the user, then defines additional substitutions that the project template can use. All well and good.
This template was previously a collection of several very similar templates, which differed only in which interface was implemented by the main class. My goal is to condense this collection of templates into a single "smart template" which automatically implements the correct interface depending on user input.
To do that, I need to modify the generated code at the time it is created. Visual Studio calls my custom wizard code after the new project is created, then I'd like to go into the newly-created C# code and add the Interface implementation programmatically. I'd like to add the " : IMyInterface" after the main class, then trigger IntelliSense to expand the implementation for me. This is the part I don't know how to do.
Can anyone give me some pointers on how to automate the imlementation of an interface using the Visual Studio object model?