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);
     }
 }
Beispiel #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();
            }
        }
Beispiel #3
0
 public virtual void OnInitialize(WebsiteInstance wi, AspNetApplication app)
 {
     _wi  = wi;
     _app = app;
 }