示例#1
0
 public CachedData(SerializableCachedData scd) : base()
 {
     Pass             = scd.Pass;
     PollServerFailed = scd.PollServerFailed;
     foreach (License l in scd.LicenseList)
     {
         LicenseDirectory.Add(l.Name, l);
     }
 }
示例#2
0
        /// <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();
        }