public ScriptEngine(WebClient client)
{
m_Client = client;
m_AppDomain = AppDomain.CreateDomain("ScriptEngine");
m_Site = new MyVsaSite(this);
m_Engine = new Microsoft.JScript.Vsa.VsaEngine(false);
m_Engine.RootMoniker = "Cb://Web/Scripting";
//m_Engine.Site = (IJSVsaSite) m_Site;
m_Engine.InitNew();
m_Engine.RootNamespace = GetType().Namespace;
m_Engine.SetOption("AlwaysGenerateIL", false);
m_Engine.SetOption("CLSCompliant", false);
m_Engine.GenerateDebugInfo = true;
m_Engine.SetOutputStream(new EmptyMessageReceiver());
SetGlobalObject("Context", this);
AddCodeBlock("__init",
@"
function alert(msg) { Context.Alert(msg); }
function confirm(msg) { return Context.Confirm(msg); }
function setInterval(funcName, delay) { Context.SetInterval(funcName, delay); }
" );
}