public CachedData(SerializableCachedData scd) : base() { Pass = scd.Pass; PollServerFailed = scd.PollServerFailed; foreach (License l in scd.LicenseList) { LicenseDirectory.Add(l.Name, l); } }
/// <summary> /// Save License information to cache file. /// </summary> public static void Save() { // Avoid problem where serialization of IDictionary is not supported. Use IList instead. SerializableCachedData serializableLicenseInfo = new SerializableCachedData(licenseInfo); XmlSerializer x = new XmlSerializer(serializableLicenseInfo.GetType()); TextWriter WriteFileStream = new StreamWriter(Path); x.Serialize(WriteFileStream, serializableLicenseInfo); WriteFileStream.Close(); }