protected virtual void GetLinesOfPage(Intarray lines, int ipage) { lines.Clear(); string dirName = String.Format("{0}{1}{2:0000}", prefix, Path.DirectorySeparatorChar, ipage); DirPattern dpattern = new DirPattern(dirName, @"([0-9][0-9][0-9][0-9])\.png"); if (dpattern.Length > 0) { lines.ReserveTo(dpattern.Length); } List <int> llist = new List <int>(dpattern.Length); for (int i = 0; i < dpattern.Length; i++) { int k = int.Parse(dpattern[i]); llist.Add(k); //lines.Push(k); } IEnumerable <int> query = llist.OrderBy(i => i); foreach (int iline in query) { lines.Push(iline); } }
public override void SetPrefix(string prefix) { if (DirPattern.Exist(prefix, @"[0-9][0-9][0-9][0-9]", @"([0-9][0-9][0-9][0-9])\.png")) { Global.Debugf("info", "selecting OldBookStore"); p = new OldBookStore(); } else { Global.Debugf("info", "selecting (new) BookStore"); p = new BookStore(); } p.SetPrefix(prefix); }
protected override void GetLinesOfPage(Intarray lines, int ipage) { lines.Clear(); string dirName = String.Format("{0}{1}{2:0000}", prefix, Path.DirectorySeparatorChar, ipage); //DirPattern dpattern = new DirPattern(dirName, @"([0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])\.png"); DirPattern dpattern = new DirPattern(dirName, @"([0-9][0-9][0-9][0-9][0-9][0-9])\.png"); if (dpattern.Length > 0) lines.ReserveTo(dpattern.Length); for (int i = 0; i < dpattern.Length; i++) { int k = int.Parse(dpattern[i]); lines.Push(k); } }
public virtual int GetMaxPage(string fpattern) { int npages = -1; DirPattern dpattern = new DirPattern(prefix, fpattern); for (int i = 0; i < dpattern.Length; i++) { int p = -1; int.TryParse(dpattern[i], out p); if (p > npages) { npages = p; } } npages++; return(npages); }
protected override void GetLinesOfPage(Intarray lines, int ipage) { lines.Clear(); string dirName = String.Format("{0}{1}{2:0000}", prefix, Path.DirectorySeparatorChar, ipage); //DirPattern dpattern = new DirPattern(dirName, @"([0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])\.png"); DirPattern dpattern = new DirPattern(dirName, @"([0-9][0-9][0-9][0-9][0-9][0-9])\.png"); if (dpattern.Length > 0) { lines.ReserveTo(dpattern.Length); } for (int i = 0; i < dpattern.Length; i++) { int k = int.Parse(dpattern[i]); lines.Push(k); } }
protected virtual void GetLinesOfPage(Intarray lines, int ipage) { lines.Clear(); string dirName = String.Format("{0}{1}{2:0000}", prefix, Path.DirectorySeparatorChar, ipage); DirPattern dpattern = new DirPattern(dirName, @"([0-9][0-9][0-9][0-9])\.png"); if (dpattern.Length > 0) lines.ReserveTo(dpattern.Length); List<int> llist = new List<int>(dpattern.Length); for (int i = 0; i < dpattern.Length; i++) { int k = int.Parse(dpattern[i]); llist.Add(k); //lines.Push(k); } IEnumerable<int> query = llist.OrderBy(i => i); foreach (int iline in query) lines.Push(iline); }
public virtual int GetMaxPage(string fpattern) { int npages = -1; DirPattern dpattern = new DirPattern(prefix, fpattern); for (int i = 0; i < dpattern.Length; i++) { int p = -1; int.TryParse(dpattern[i], out p); if (p > npages) npages = p; } npages++; return npages; }