Exemplo n.º 1
0
        private Dictionary <int, string> GetDictionaryFromCache(TestCacheItem testCacheItem, int numberOfItems)
        {
            Trace.WriteLine("Method call: GetDictionaryFromCache(TestCacheItem, int)");

            return(SlimCacheManager.LoadFromCache <Dictionary <int, string> >(
                       testCacheItem.ToString()
                       , delegate { return GetHugeDictionary(numberOfItems); }));
        }
Exemplo n.º 2
0
 private SimpleObject GetCacheItem(int index)
 {
     return(SlimCacheManager.LoadFromCache <SimpleObject>(
                "TestItem"
                , delegate
     {
         Trace.WriteLine("DELEGATE CALL TO: ___START___  GetCacheItem, INDEX: " + index);
         Thread.Sleep(200);
         Trace.WriteLine("DELEGATE CALL TO: ___FINISH___  GetCacheItem, INDEX: " + index);
         return new SimpleObject()
         {
             MyString = "________" + index + "_________________________________________________ " + DateTime.UtcNow.ToString("HH:mm:ss.fff"),
             MyValue = index
         };
     }));
 }
Exemplo n.º 3
0
 private SimpleObject GetCacheItem2()
 {
     Trace.WriteLine("*************** GetCacheItem2 call at: " + DateTime.UtcNow.ToString("HH:mm:ss.fff") + " ******************");
     return(SlimCacheManager.LoadFromCache <SimpleObject>(
                "TestItem2"
                , delegate
     {
         Trace.WriteLine("DELEGATE CALL TO: ___FINISH___  GetCacheItem2");
         return new SimpleObject()
         {
             MyString = "_________________________________________________________ " + DateTime.UtcNow.ToString("HH:mm:ss.fff")
             ,
             MyValue = 0
         };
     }));
 }