Microsoft.JScript.Vsa.VsaEngine.CreateMain C# (CSharp) Method

CreateMain() private method

private CreateMain ( ) : void
return void
      private void CreateMain(){
        // define a class that will hold the main method
        TypeBuilder mainClass = this.CompilerGlobals.module.DefineType("JScript Main", TypeAttributes.Public);
      
        // create a function with the following signature void Main(String[] args)
        MethodBuilder main = mainClass.DefineMethod("Main", MethodAttributes.Public | MethodAttributes.Static, Typeob.Void, new Type[]{Typeob.ArrayOfString});
        ILGenerator il = main.GetILGenerator();

        // emit code for main method
        this.CreateEntryPointIL(il, null /* site */);

        // cook method and class
        mainClass.CreateType();
        // define the Main() method as the entry point for the exe
        this.CompilerGlobals.assemblyBuilder.SetEntryPoint(main, this.PEFileKind);
      }