public AdsXmlFormat GetXmlFormat(string xmlPath)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(List <AdsXmlFormat>));
            FileStream    outstream  = new System.IO.FileStream(xmlPath, System.IO.FileMode.Open);

            var adsXmlCollection = (List <AdsXmlFormat>)serializer.Deserialize(outstream);

            outstream.Close();

            AdsXmlFormat def = null;

            foreach (var ads in adsXmlCollection)
            {
                if (ads.Version == _version)
                {
                    return(ads);
                }
                if (ads.Version == "Default")
                {
                    def = ads;
                }
            }

            return(def);
        }
Exemplo n.º 2
0
        private void StartImageDownloading()
        {
            _state = DownloadState.ImageDownloading;
            try
            {
                _recentDownloadedXmlFormat = _xmlFormatManager.GetXmlFormat(GetDownloadedXmlPath());
                if (_recentDownloadedXmlFormat == null)
                {
                    return;
                }

                AsyncLoadFile(_recentDownloadedXmlFormat.DownloadFile, GetDownloadedImagePath());
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 3
0
        private void StartImageDownloading()
        {
            _state = DownloadState.ImageDownloading;
            try
            {
                _recentDownloadedXmlFormat = _xmlFormatManager.GetXmlFormat(GetDownloadedXmlPath());
                if (_recentDownloadedXmlFormat == null)
                {
                    return;
                }

                AsyncLoadFile(_recentDownloadedXmlFormat.DownloadFile, GetDownloadedImagePath());
            }
            catch (Exception )
            {
            }
        }