Visual Studio Extensions

Posted by John Maloney on Stack Overflow See other posts from Stack Overflow or by John Maloney
Published on 2012-04-12T15:31:44Z Indexed on 2012/04/15 5:29 UTC
Read the original article Hit count: 364

I have a project that generates text (representing an interface and a class) based on metadata. I would like to take this generated code and insert it as a new class and interface directly into the currently opened solution under a specific project and directory. I will create the menu tool that will generate the class but what I don't know how to do is gain access to the following items from within my custom Visual Studio Extension:

  1. Iterate the current solution and find a project to dump the generated code into.
  2. Open a new file window within Visual Studio and inject the generated text that comes from my tool directly into that window.
  3. Create a new folder in a specific project within the current solution from within my custom extension.

EDIT - To clarify I need to open a new file (e.g. Right Click on a Project -> Add - > New Class) and insert text into it from within my custom Visual Studio Extension.

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about visual-studio-2010