示例#1
0
 public static void Clear()
 {
     System.Collections.IDictionaryEnumerator enumerator = PowerCache.SystemCache.GetEnumerator();
     while (enumerator.MoveNext())
     {
         PowerCache.Remove(enumerator.Key.ToString());
     }
 }
示例#2
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);
                }
            }
        }