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

CreateStartupClass() private method

private CreateStartupClass ( ) : void
return void
      private void CreateStartupClass(){
        // define _Startup class for VSA (in the RootNamespace)
        Debug.Assert(this.rootNamespace != null && this.rootNamespace.Length > 0);
        TypeBuilder startupClass = this.CompilerGlobals.module.DefineType(this.rootNamespace + "._Startup", TypeAttributes.Public, Typeob.BaseVsaStartup);
        FieldInfo site = Typeob.BaseVsaStartup.GetField("site", BindingFlags.NonPublic | BindingFlags.Instance);
        // create a function with the following signature: public virtual void Startup()
        MethodBuilder startup = startupClass.DefineMethod("Startup", MethodAttributes.Public | MethodAttributes.Virtual, Typeob.Void, Type.EmptyTypes);
        this.CreateEntryPointIL(startup.GetILGenerator(), site, startupClass);
        // create a function with the following signature: public virtual void Shutdown()
        MethodBuilder shutdown = startupClass.DefineMethod("Shutdown", MethodAttributes.Public | MethodAttributes.Virtual, Typeob.Void, Type.EmptyTypes);
        this.CreateShutdownIL(shutdown.GetILGenerator());

        // cook method and class
        startupClass.CreateType();
      }