using System.Collections.Generic; public static class LocalCacheManager { private static Dictionary dictionary = new Dictionary(); public static void Save(string tag, object value){ dictionary[tag] = value; } public static T Load(string tag, T defaultValue){ if(Exists(tag)){ return Load(tag); }else{ return defaultValue; } } public static T Load(string tag){ return (T)dictionary[tag]; } public static bool Exists(string tag){ return dictionary.ContainsKey(tag); } public static bool Remove(string tag){ return dictionary.Remove(tag); } public static void Clear(){ dictionary.Clear(); } }