Пример #1
0
 static public WebsiteInstance GetOrCreate(long uid)
 {
     lock (__instmap)
     {
         WebsiteInstance inst;
         if (__instmap.TryGetValue(uid, out inst))
         {
             return(inst);
         }
         inst           = new WebsiteInstance(uid);
         __instmap[uid] = inst;
         return(inst);
     }
 }
Пример #2
0
        void GlobalApplication_BeginRequest(object sender, EventArgs e)
        {
            _requestcompleted = false;

            WebsiteRequest wt = CreateWebsiteRequest();

            if (_requestcompleted || Response.IsRequestBeingRedirected)
            {
                return;
            }

            if (wt == null)
            {
                MapToDefaultDocument();
                return;
            }

            try
            {
                WebsiteInstance wi = WebsiteInstance.GetOrCreate(wt.UniqueID);

                wt.OnInitialize(wi, this);

                SendWebsiteRequest(wt);

                wt.InitResponse();

                SendWebsiteResponse(wt);

                this.Response.Flush();

                this.CompleteRequest();
            }
            finally
            {
                wt.Dispose();
            }
        }
Пример #3
0
 public virtual void OnInitialize(WebsiteInstance wi, AspNetApplication app)
 {
     _wi  = wi;
     _app = app;
 }