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