Exemple #1
0
        private void Generator_Cache(HttpContext context, HttpRequest request, string key, UrlItem urlitem)
        {
            if (request.QueryString[GENERATOR_TAG] == null)
            {
                lock (mGenerator)
                {
                    if (mGenerator.ContainsKey(key))
                    {
                        return;
                    }

                    GetUrlItem item = new GetUrlItem();
                    item.Item  = urlitem;
                    item.Cache = context.Cache;
                    item.URL   = context.Request.Url.ToString();
                    item.Key   = key;
                    if (request.QueryString.Count == 0)
                    {
                        item.URL += "?";
                    }
                    else
                    {
                        item.URL += "&";
                    }
                    item.URL      += "_cache_generator=true";
                    item.Completed = Generator_Completed;
                    mGenerator.Add(key, key);
                    GetDespatch.Add(item);
                }
            }
        }
        private void Generator_Cache(HttpContext context, HttpRequest request, string key,UrlItem urlitem)
        {
            if (request.QueryString[GENERATOR_TAG] == null)
            {
                lock (mGenerator)
                {
                    if (mGenerator.ContainsKey(key))
                        return;

                    GetUrlItem item = new GetUrlItem();
                    item.Item = urlitem;
                    item.Cache = context.Cache;
                    item.URL = context.Request.Url.ToString();
                    item.Key = key;
                    if (request.QueryString.Count == 0)
                    {
                        item.URL += "?";
                    }
                    else
                    {
                        item.URL += "&";
                    }
                    item.URL += "_cache_generator=true";
                    item.Completed = Generator_Completed;
                    mGenerator.Add(key, key);
                    GetDespatch.Add(item);
                }
            }
        }
Exemple #3
0
 private void Generator_Completed(IDespatchItem item)
 {
     lock (mGenerator)
     {
         GetUrlItem gui = (GetUrlItem)item;
         mGenerator.Remove(gui.Key);
     }
 }