public void Close() { if (this.startupInstance != null) { try { this.startupInstance.Shutdown(); this.startupInstance = null; } catch (Exception exception) { throw new JSVsaException(JSVsaError.EngineCannotReset, exception.ToString(), exception); } } this.engine.Close(); }
private bool LoadAssembly(byte[] pe, byte[] pdb) { try { Assembly assembly = Assembly.Load(pe, pdb, SecurityContextSource.CurrentAppDomain); Type type = assembly.GetType(this.engine.RootNamespace + "._Startup"); this.startupInstance = (BaseVsaStartup)Activator.CreateInstance(type); this.startupInstance.SetSite(this.engine.Site); this.startupInstance.Startup(); Type type2 = assembly.GetType(this.engine.RootNamespace + ".__WebProxyScript"); this.scriptInstance = Activator.CreateInstance(type2); CallMethod(this.scriptInstance, "SetEngine", new object[] { this.engine }); } catch { return(false); } return(true); }