Example #1
0
        public static Licenses LoadLicenses(string data)
        {
            try {
                XmlSerializer serializer = new XmlSerializer(typeof(Licenses));                //,xRoot);

                Licenses banners = (Licenses)serializer.Deserialize((new StringReader(data)));
                return(banners);
            }catch (Exception ex) {
                Moscrif.IDE.Tool.Logger.Error("Load License :" + ex.Message);
                Console.WriteLine("Load License ->" + ex.Message);
                return(new Licenses());
            }
        }
Example #2
0
        public static Licenses OpenLicensesCache()
        {
            string bannerCachePath = System.IO.Path.Combine(MainClass.Paths.BannerCache, "licenses.xml");

            if (File.Exists(bannerCachePath))
            {
                using (FileStream fs = File.OpenRead(bannerCachePath)) {
                    XmlSerializer serializer = new XmlSerializer(typeof(Licenses));

                    Licenses banners = (Licenses)serializer.Deserialize(fs);
                    banners.IsCache = true;
                    return(banners);
                }
            }
            return(new Licenses());
        }