public static ImageInfoContainer Load(string fileName) { var doc = FileUtility.LoadXml(fileName, StreamOptions.GZip); var result = new ImageInfoContainer(); result._imageInfos = doc.Descendants("item").Select(x => { var name = x.Element("fileName").Value; var lastAccessTime = DateTime.Parse(x.Element("lastAccessTime").Value); return new ImageInfo(name, lastAccessTime); }).ToDictionary(x => x.FileName); return result; }
public void Load() { if (string.IsNullOrWhiteSpace(ImageInfoContainerFileName)) throw new InvalidOperationException(); _imageInfoContainer = ImageInfoContainer.Create(ImageInfoContainerFileName); }