Beispiel #1
0
 public void GetCache(DataType type, Dictionary <int, Tuple <int, byte[]> > dictPNG)
 {
     foreach (int idx in dictPNG.Keys.ToArray <int>())
     {
         NetCacheControl.CacheHeader ch = (NetCacheControl.CacheHeader)null;
         string cacheHeader             = this.GetCacheHeader(type, idx, out ch);
         if (ch != null)
         {
             dictPNG[ch.idx] = new Tuple <int, byte[]>(ch.update_idx, this.LoadCache(cacheHeader, ch.pos, ch.size));
         }
     }
 }
Beispiel #2
0
 public string GetCacheHeader(DataType type, int idx, out NetCacheControl.CacheHeader ch)
 {
     ch = (NetCacheControl.CacheHeader)null;
     foreach (KeyValuePair <string, List <NetCacheControl.CacheHeader> > keyValuePair in this.dictCacheHeaderInfo[(int)type])
     {
         foreach (NetCacheControl.CacheHeader cacheHeader in keyValuePair.Value)
         {
             if (cacheHeader.idx == idx)
             {
                 ch            = new NetCacheControl.CacheHeader();
                 ch.idx        = cacheHeader.idx;
                 ch.update_idx = cacheHeader.update_idx;
                 ch.pos        = cacheHeader.pos;
                 ch.size       = cacheHeader.size;
                 return(keyValuePair.Key);
             }
         }
     }
     return(string.Empty);
 }