public static void SetInstance(RegistrationCache cache) { if (_cache != null) { return; } lock (_locker) if (_cache == null) { _cache = cache; } }
public static void SaveCacheToFile(RegistrationCache cache, string fileName) { File.WriteAllText(fileName, JsonConvert.SerializeObject(cache, Newtonsoft.Json.Formatting.Indented)); }