private void OnPictureChooserClicked(object sender, EventArgs e)
 {
     var images = new ArtOfReadingImageCollection();
     images.LoadIndex(Path.Combine(Assembly.GetEntryAssembly().Location, "ImageGallery/artofreadingindexv3_en.txt"));
     images.RootImagePath = RootImagePath.Text;
     var form = new PictureChooser(images, "duck");
     Application.Run(form);
     Result.Text = "Result: " + form.ChosenPath;
 }
        public static IImageCollection FromStandardLocations()
        {
            string path = TryToGetRootImageCatalogPath();
            if (DoNotFindArtOfReading_Test)
                path = null;

            if (path == null)
                return null;

            var c = new ArtOfReadingImageCollection();

            c.RootImagePath = path;

            string pathToIndexFile = TryToGetPathToIndex(path);
            c.LoadIndex(pathToIndexFile);
            return c;
        }
        public static IImageCollection FromStandardLocations()
        {
            string path = TryToGetRootImageCatalogPath();

            if (DoNotFindArtOfReading_Test)
            {
                path = null;
            }

            if (path == null)
            {
                return(null);
            }

            var c = new ArtOfReadingImageCollection();

            c.RootImagePath = path;

            string pathToIndexFile = TryToGetPathToIndex(path);

            c.LoadIndex(pathToIndexFile);
            return(c);
        }
		public void Setup()
		{
			_artCollection = new Palaso.UI.WindowsForms.ImageGallery.ArtOfReadingImageCollection();
			_artCollection.LoadIndex(IndexPath);
		}
		public static IImageCollection FromStandardLocations(string lang)
		{
			string path = TryToGetRootImageCatalogPath();
			if (DoNotFindArtOfReading_Test)
				path = null;

			if (path == null)
				return null;

			var c = new ArtOfReadingImageCollection();

			c.RootImagePath = path;
			c.GetIndexLanguages();
			c.SearchLanguage = lang;

			// Load the index information asynchronously so as not to delay displaying
			// the parent dialog.  Loading the file takes a second or two, but should
			// be done before the user finishes typing a search string.
			var thr = new Thread(c.LoadImageIndex);
			thr.Name = "LoadArtOfReadingIndex";
			thr.Start();

			return c;
		}