This extension provides a C# REPL Scripting environment (based on O2 Platforms's FluentSharp APIs). In addition to being able to write and execute quick C# snippets (in a REPL environment), you can program VisualStudio IDE in real time! Here is a code sample that shows how to use FluentSharp's VisualStudio API to manipulate multiple parts of the VisualStudio IDE: C# Edit|Remove csharp//get a reference to the VisualStudio APIvar visualStudio = new VisualStudio_2010();//write an Error and Warning messages to the 'Error List' VisualStudio WindowvisualStudio.errorList().add_Error("I'm an Error");visualStudio.errorList().add_Warning("I'm an Warning"); //open a text filevisualStudio.open_Document("a text file".saveWithExtension(".exe"));//open a C# filevisualStudio.open_Document(@"VS_Scripts\O2_Platform_Gui.cs".local());//open a WebBrowservisualStudio.open_WebBrowser(@"http://diniscruz.blogspot.co.uk/search/label/O2%20Platform");//add a top MenuvisualStudio.dte().add_TopMenu("A new Menu") .add_Menu_Button("Ask me a question", ()=> "Hi {0}".alert("What is your name?".askUser()));//change the main title visualStudio.mainWindow().title(visualStudio.mainWindow().title() + " - Now with REPL");//change the status barvisualStudio.statusBar("C# script example complete");//return the EnvDTE objectreturn visualStudio.dte(); //get a reference to the VisualStudio API var visualStudio = new VisualStudio_2010(); //write an Error and Warning messages to the 'Error List' VisualStudio Window visualStudio.errorList().add_Error("I'm an Error"); visualStudio.errorList().add_Warning("I'm an Warning"); //open a text file visualStudio.open_Document("a text file".saveWithExtension(".exe")); //open a C# file visualStudio.open_Document(@"VS_Scripts\O2_Platform_Gui.cs".local()); //open a WebBrowser visualStudio.open_WebBrowser(@"http://diniscruz.blogspot.co.uk/search/label/O2%20Platform"); //add a top Menu visualStudio.dte().add_TopMenu("A new Menu") .add_Menu_Button("Ask me a question", ()=> "Hi {0}".alert("What is your name?".askUser())); //change the main title visualStudio.mainWindow().title(visualStudio.mainWindow().title() + " - Now with REPL"); //change the status bar visualStudio.statusBar("C# script example complete"); //return the EnvDTE object return visualStudio.dte(); FluentSharp is an API that dramatically simplifies the use of .NET Framework APIs. It makes extensive use of .NET ExtensionMethods and it reduces the amount of code required (while making it more readable). To use FluentSharp in your VisualStudio project you can use NuGet: http://nuget.org/packages?q=fluentSharp For more information and script examples see:
Screnshots:1) Menu created by installer: 2) C# REPL environment with FluentSharp VisualStudio API 3) Executing the Sample Script provided (2nd link from the REPL menu) 4) What VisualStudio looks like after executing the sample script Troubleshoot1) if you get this window: That means that the script file that creates the REPL menu failed to compile (the file path is the one shown in the Output window) The best way to debug this error is to compile that script (see image below) and ping dinis.cruz@owasp.org with the result: |