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); }
private void StartImageDownloading() { _state = DownloadState.ImageDownloading; try { _recentDownloadedXmlFormat = _xmlFormatManager.GetXmlFormat(GetDownloadedXmlPath()); if (_recentDownloadedXmlFormat == null) { return; } AsyncLoadFile(_recentDownloadedXmlFormat.DownloadFile, GetDownloadedImagePath()); } catch (Exception) { } }
private void StartImageDownloading() { _state = DownloadState.ImageDownloading; try { _recentDownloadedXmlFormat = _xmlFormatManager.GetXmlFormat(GetDownloadedXmlPath()); if (_recentDownloadedXmlFormat == null) { return; } AsyncLoadFile(_recentDownloadedXmlFormat.DownloadFile, GetDownloadedImagePath()); } catch (Exception ) { } }