private void SetCacheManager() { try { using (FileStream stream = File.Open(App.UserAppDataPath + @"\" + Settings.Default.CacheManagerFile, FileMode.Open)) { XmlSerializer serializer = new XmlSerializer(typeof(ClientApp.CacheManager)); this._cacheManager = (ClientApp.CacheManager)serializer.Deserialize(stream); } } catch (Exception exception) { Trace.WriteLine(new LogMessage("AdvertPlayer - SetCacheManager", "Unable to reuse the Cache Manager because: " + exception.Message)); this._cacheManager = new ClientApp.CacheManager(); } try { this._cacheManager.Regenerate(); } catch (Exception exception2) { Trace.WriteLine(new LogMessage("AdvertPlayer - SetCacheManager", "Regenerate failed because: " + exception2.Message)); } }