public override void Execute(string src, Uri uri, HttpListenerContext p, WebConfig wc, StreamWriter sw)
        {
            var bcp = new CSharpCodeProvider();
            var ass = AssemblyInitializer.Init(bcp, src, sw, ini);

            var page = AssemblyPageResolver.Resolve(ass);

            page.Response = sw;

            uri = new Uri("http://localhost/" + Path.GetFileName(uri.LocalPath));

            page.Info        = new HttpInfo(Get.Create(uri), uri, wc.DataDir, p);
            page.IncludePage = new Action <string>(f =>
            {
                new Language().Execute(File.ReadAllText(wc.DataDir + f), uri, p, wc, sw);
            });
            page.Redirect = new Action <string>(f =>
            {
                p.Response.Redirect(f);
            });
            page.Isset = new Predicate <object>(b => {
                return(StandardScriptApi.isset(b));
            });

            page.Get = page.Info.Get;

            page.OnLoad();
        }
Exemple #2
0
        public override void Execute(string src, HttpListenerContext p, WebConfig wc)
        {
            var bcp  = new Microsoft.VisualC.VSCodeProvider();
            var ass  = AssemblyInitializer.Init(bcp, src, new StreamWriter(p.Response.OutputStream));
            var page = AssemblyPageResolver.Resolve(ass);

            page.Response    = new StreamWriter(p.Response.OutputStream);
            page.Info        = new HttpInfo(Get.Create(p), p.Request.Url, wc.DataDir);
            page.IncludePage = new Action <string>(f =>
            {
                new Language().Execute(File.ReadAllText(wc.DataDir + f), p, wc);
            });

            page.OnLoad();
        }