static void CompileAllFiles() { CSharpScript.Compiler cSharpScriptCompiler = new CSharpScript.Compiler(); cSharpScriptCompiler.OnErrorOccured += new EventHandler<CSharpScript.NotificationDetails>( cSharpScriptCompiler_ErrorOccured ); cSharpScriptCompiler.OnWarningOccured += new EventHandler<CSharpScript.NotificationDetails>( cSharpScriptCompiler_WarningOccured ); cSharpScriptCompiler.CompileScriptFiles( Directory.GetFiles( @"..\..\..\Examples\Example 01 Transportable", "*.chs" ) ); }
static void ConvertOneFile() { CSharpScript.Compiler cSharpScriptCompiler = new CSharpScript.Compiler(); string file = @"C:\Users\nicu\Projects\C Sharp Script\CSharpScript\Examples\Example 01 Transportable\ITransportable.chs"; StreamWriter sw = new StreamWriter( file + ".cs" ); sw.Write( cSharpScriptCompiler.TransformScriptFileToCSharp( file ) ); sw.Close(); }
static void ConvertAllFiles() { CSharpScript.Compiler cSharpScriptCompiler = new CSharpScript.Compiler(); foreach( string file in Directory.GetFiles( @"..\..\..\Examples\Example 01 Transportable", "*.chs" ) ) { StreamWriter sw = new StreamWriter( file + ".cs" ); sw.Write( cSharpScriptCompiler.TransformScriptFileToCSharp( file ) ); sw.Close(); } }