public static void ClearStats() { string oldId = Instance.UniqueId; Instance = new UsageStats(); Instance.UniqueId = oldId; Instance.Save(); }
static UsageStats() { lock (s_SyncLock) { try { var ser = new XmlSerializer(typeof(UsageStats)); Instance = (UsageStats)ser.Deserialize(new StringReader(Properties.Settings.Default.UsageStatistics)); } catch (Exception) { Instance = new UsageStats(); } } }
static UsageStats() { lock (s_SyncLock) { try { var ser = new XmlSerializer(typeof (UsageStats)); Instance = (UsageStats)ser.Deserialize(new StringReader(Properties.Settings.Default.UsageStatistics)); } catch (Exception) { Instance = new UsageStats(); } } }