public void SaveList(ImgList list) { ImgListItem item; list.Sort(); sw = new sio.StreamWriter(extractDir + ImageListName, false, ste.UTF8); for (int i = 0; i < list.Count; i++) { item = list[i]; sw.WriteLine("type={0},depth={1},width={2},height={3},name={4},png_alias={5},rel_name={6},hash={7}", new object[] { item.type, item.bitCount, item.width, item.height, item.name, item.pngAlias, item.fullName, item.md5png }); } sw.Close(); }
private void ReadList() { string str; sr = new sio.StreamReader(extractDir + ImageListName, ste.UTF8); rList = new ImgList(); while (!string.IsNullOrEmpty(str = sr.ReadLine())) rList.AddUnsorted(new ImgListItem(str, true)); sr.Close(); rList.Sort(); }
public void Extract() { if (!sio.Directory.Exists(imgDir)) throw new sio.DirectoryNotFoundException(string.Format("Directory '{0}' not found", imgDir)); imgDir = misc.DirCreateAndCheck(imgDir); extractDir = misc.DirCreateAndCheck(extractDir); gList = new ImgList(); globalCounter = 0; ExtractImg(imgDir); if (gList.Count > 0) { for (int i = 0; i < gList.Count; i++) gList[i].SetMd5(gList[i].md5png); gList.Sort(); SaveList(gList); Console.WriteLine("Export done"); } else Console.WriteLine("Nothing to export"); }