public DirImageRepository(string[] dirnames_in) { num_images = 0; ArrayList dirlist = new ArrayList(); for (int i = 0; i < dirnames_in.Length; i++) { string name = dirnames_in [i].TrimEnd(Util.DirSep); if (Directory.Exists(name)) { dirlist.Add(name); } } directories = new DirImageCollection [dirlist.Count]; for (int i = 0; i < directories.Length; i++) { directories [i] = new DirImageCollection(this, i, (string)dirlist [i]); num_images += directories [i].Count; foreach (string s in directories[i].Keywords.Keys) { keywords [s] = true; } } #if NO_MULTITHREAD thumbnailer = new Thumbnailer(); #else thumbnailer = new Thumbnailer(); thumbnailer.OnThumbnailFinished += new Thumbnailer.OnThumbnailFinishedHandler(ThumbnailsAvailable); #endif }
public DirImageRepository (string[] dirnames_in) { num_images = 0; ArrayList dirlist = new ArrayList (); for (int i = 0; i < dirnames_in.Length; i++) { string name = dirnames_in [i].TrimEnd (Util.DirSep); if (Directory.Exists (name)) dirlist.Add (name); } directories = new DirImageCollection [dirlist.Count]; for (int i = 0; i < directories.Length; i++){ directories [i] = new DirImageCollection (this, i, (string) dirlist [i]); num_images += directories [i].Count; foreach (string s in directories [i].Keywords.Keys) keywords [s] = true; } #if NO_MULTITHREAD thumbnailer = new Thumbnailer (); #else thumbnailer = new Thumbnailer (); thumbnailer.OnThumbnailFinished += new Thumbnailer.OnThumbnailFinishedHandler (ThumbnailsAvailable); #endif }
void LookupFromID (string id, out DirImageCollection image_dir, out string name) { int p = id.LastIndexOf ("/"); string d = id.Substring (0, p); name = id.Substring (p + 1); for (int i = 0; i < directories.Length; i++){ if (d == directories [i].Path){ image_dir = directories [i]; return; } } image_dir = null; }
void LookupFromID(string id, out DirImageCollection image_dir, out string name) { int p = id.LastIndexOf("/"); string d = id.Substring(0, p); name = id.Substring(p + 1); for (int i = 0; i < directories.Length; i++) { if (d == directories [i].Path) { image_dir = directories [i]; return; } } image_dir = null; }