static void Main(string[] args) { //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler((sender,e)=> { Console.WriteLine(e.ExceptionObject); } ); if (Control.ModifierKeys == Keys.Shift) showLogViewer(); //.parentForm().width(1000).height(400); var firstScript = AppDomain.CurrentDomain.BaseDirectory.pathCombine("AppScan_Standard_1st_Script.cs"); Console.WriteLine("Welcome to the O2 Platform ..."); Console.WriteLine("Launching IBM AppScan Standard ..."); "Current AppDomain: {0}".info(AppDomain.CurrentDomain.BaseDirectory); //CompileEngine.lsGACExtraReferencesToAdd.Clear(); var assembly = new CompileEngine().compileSourceFile(firstScript); if (assembly.notNull()) { Console.WriteLine("Executing script {0} from location {1}".info(firstScript, assembly.Location)); if (assembly.methods().size()>0) { assembly.methods()[0].invoke(); Console.WriteLine("Invocation complete".info()); } else Console.WriteLine("Error: there were no methods in compiled assembly".error()); } else Console.WriteLine("Error: could not find, compile or execute first script ({0})".error(firstScript)); }
public override void create() { this.ButtonText = "O2 Script - with Panel"; this.ToolTip = "Opens the O2 Script Guid (with a top panel)"; this.TargetMenu = "O2 Platform"; base.create(); this.Execute = () => { var script = "ascx_Quick_Development_GUI.cs.o2".local(); var assembly = new CompileEngine().compileSourceFile(script); assembly.methods()[0].invoke(new object[] { }); //assembly.executeFirstMethod(); }; }