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);
        }
예제 #2
0
        private void StartImageDownloading()
        {
            _state = DownloadState.ImageDownloading;
            try
            {
                _recentDownloadedXmlFormat = _xmlFormatManager.GetXmlFormat(GetDownloadedXmlPath());
                if (_recentDownloadedXmlFormat == null)
                {
                    return;
                }

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

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