示例#1
0
        public static string Serialize(ImageSet imageSet)
        {
            var str = new StringBuilder();

            str.AppendLine(imageSet.Index.ToString());
            str.AppendLine(string.Join(",", imageSet.Images));
            return(str.ToString());
        }
示例#2
0
        public static RecoveryState Deserialize(string data)
        {
            using (var sr = new StringReader(data))
            {
                var selectionIndices = sr.ReadLine().Split(',').Select(s => int.Parse(s)).ToList();
                var imageSets        = sr.ReadToEnd().Split(';').Select(s => ImageSet.Deserialize(s)).ToArray();

                return(new RecoveryState(selectionIndices, imageSets));
            }
        }
示例#3
0
 public override string ToString()
 {
     return(ImageSet.Serialize(this));
 }