Exemplo n.º 1
0
 public static void Clear()
 {
     System.Collections.IDictionaryEnumerator enumerator = PowerCache.SystemCache.GetEnumerator();
     while (enumerator.MoveNext())
     {
         PowerCache.Remove(enumerator.Key.ToString());
     }
 }
Exemplo n.º 2
0
 internal static ModelTypeData GetModelTypeData(System.Type type)
 {
     return(PowerCache.Get <ModelTypeData>(string.Concat(new object[]
     {
         "Power::ModelTypeData::",
         type.Name,
         "::",
         type.GUID
     }), () => ModelTypeDataProvider.ReflectClass(type), null, 2147483647, null, true, CacheItemPriority.Normal));
 }
Exemplo n.º 3
0
        public static void Clear(string pattern)
        {
            System.Collections.IDictionaryEnumerator enumerator = PowerCache.SystemCache.GetEnumerator();
            Regex regex = new Regex(pattern, RegexOptions.ExplicitCapture | RegexOptions.Compiled | RegexOptions.Singleline);

            while (enumerator.MoveNext())
            {
                string text = enumerator.Key.ToString();
                if (regex.IsMatch(text))
                {
                    PowerCache.Remove(text);
                }
            }
        }