示例#1
0
 public static object Retrieve(ApplicationItemContainerKey key)
 {
     if (HttpContext.Current != null && HttpContext.Current.Application != null)
     {
         HttpApplicationState application = HttpContext.Current.Application;
         if (application[BuildKey(key)] != null)
         {
             return(application[BuildKey(key)]);
         }
         else
         {
             return(null);
         }
     }
     else
     {
         if (_fakeApplicationContainer.ContainsKey(BuildKey(key)))
         {
             return(_fakeApplicationContainer[BuildKey(key)]);
         }
         else
         {
             return(null);
         }
     }
 }
示例#2
0
 public static void Store(ApplicationItemContainerKey key, object value)
 {
     if (HttpContext.Current != null && HttpContext.Current.Application != null)
     {
         HttpContext.Current.Application[BuildKey(key)] = value;
     }
     else
     {
         _fakeApplicationContainer[BuildKey(key)] = value;
     }
 }
示例#3
0
 private static string BuildKey(ApplicationItemContainerKey key)
 {
     return(string.Format("{0}_{1}", KEY_PREFIX, key.ToString()));
 }