Esempio n. 1
0
    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
    }
Esempio n. 2
0
	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
	}
Esempio n. 3
0
	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;
	}
Esempio n. 4
0
    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;
    }