Ejemplo n.º 1
0
 public dynamic getCachedData(String tableName, Int32 pageNumber)
 {
     //Debugger.Launch();
     foreach (KeyValuePair <String, dynamic> kvp in cachedTables.Where(item => item.Key == (tableName + pageNumber.ToString())).ToList())
     {
         TableCache tc = kvp.Value;
         if (tc.page == pageNumber)
         {
             return(tc.data);
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
        public void cacheTable(String tableName, Int32 pageNumber, dynamic data)
        {
            if (cachedTables.ContainsKey(tableName + pageNumber))
            {
                bool validPage = false;
                while (!validPage)
                {
                    pageNumber++;
                    validPage = !cachedTables.ContainsKey(tableName + pageNumber);
                }
            }
            TableCache t = new TableCache(pageNumber, data);

            cachedTables.Add(tableName + pageNumber.ToString(), t);
        }
Ejemplo n.º 3
0
 public void cacheTable(String tableName, Int32 pageNumber, dynamic data)
 {
     if (cachedTables.ContainsKey(tableName + pageNumber))
     {
         bool validPage = false;
         while (!validPage)
         {
             pageNumber++;
             validPage = !cachedTables.ContainsKey(tableName + pageNumber);
         }
     }
     TableCache t = new TableCache(pageNumber, data);
     cachedTables.Add(tableName+pageNumber.ToString(), t);
 }