In the folder you installed O2, if you go to the O2.Platform.Projects/binaries folder, you should find a file called O2_Platform_VisualStudio_AddIn.AddIn
That is the O2 Visual Studio 2010 AddIn, and the easiest way to load it up in VisualStudio is to add this folder into the path VisualStudio 2010 will look for Addins.
To get there:
- open VisualStudio 2010,
- go the menu Tools -> Options,
- in the popup window, go to Environment -> Add-in/Macros Securty
- Click Add
- Enter the path
It should look something like this:
Then open the Add-In manager (from the menu Options-> Add-In manager...)
Tick the 'O2_Platform_VisualStudio_AddIn' box (if it is not there you might need to reboot VisualStudio) and click OK:
After that, if all goes according to plan :) , you should see a MessageBox that looks like this:
Followed by an O2 Log Viewer WinForm and the addition of an O2 Platform menu item to Visual Studio
If you open the new O2 Platform menu you should see these 3 options:
Which look like this when opened:
What is very cool is that these are WinForm Controls running inside an (non WinForm) Visual Studio Window. Which means that we can place them anywhere inside the visualStudio GUI:
And now that we are inside VisualStudio, we can script VisualStudio from inside VisualStudio :)
For example, this is how to add a new top level menu:
How you open an empty WinForm's Panel:
And finally, here is how you add/consume an existing O2 WinForm Control. For example the ascx_Search_AST from the O2 .NET Static Analysis engine (in this case we will first load up a C# file and then browse its AST)
Let me know if you have any issues running it.
Dinis