public override void Activate() { base.Activate(); _imageCollection = ArtOfReadingImageCollection.FromStandardLocations(); if (_imageCollection == null) { throw new ConfigurationException("Could not locate image index."); } }
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 void FromStandardLocations_NoArtOfReadingInstalled_Null() { try { ArtOfReadingImageCollection.DoNotFindArtOfReading_Test = true; Assert.IsNull(ArtOfReadingImageCollection.FromStandardLocations()); } finally { ArtOfReadingImageCollection.DoNotFindArtOfReading_Test = false; } }
private void OnPictureChooserClicked(object sender, EventArgs e) { ThumbnailViewer.UseWebViewer = _useGeckoVersion.Checked; var images = new ArtOfReadingImageCollection(); images.LoadIndex(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "ImageGallery/ArtOfReadingIndexV3_en.txt")); images.RootImagePath = RootImagePath.Text; using (var form = new PictureChooser(images, "duck")) { form.ShowDialog(); Result.Text = "Result: " + form.ChosenPath; } }
private void ArtOfReadingChooser_Load(object sender, EventArgs e) { if (DesignMode) { return; } _imageCollection = ArtOfReadingImageCollection.FromStandardLocations(); if (_imageCollection == null) { //label1.Visible = _searchTermsBox.Visible = _searchButton.Visible = _thumbnailViewer.Visible = false; _messageLabel.Visible = true; _messageLabel.Font = new Font(SystemFonts.DialogFont.FontFamily, 10); _messageLabel.Text = @"This computer doesn't appear to have the 'International Illustrations: the Art Of Reading' gallery installed yet."; // Adjust size to avoid text truncation _messageLabel.Size = new Size(400, 100); betterLinkLabel1.Visible = true; } else { #if DEBUG // _searchTermsBox.Text = @"flower"; #endif if (string.IsNullOrEmpty(_searchTermsBox.Text)) { _messageLabel.Visible = true; _messageLabel.Font = new Font(SystemFonts.DialogFont.FontFamily, 10); _messageLabel.Text = "This is the 'Art Of Reading' gallery. In the box above, type what you are searching for, then press ENTER. You can type words in English and Indonesian.".Localize("ImageToolbox.EnterSearchTerms"); // Adjust size to avoid text truncation _messageLabel.Height = 100; } _thumbnailViewer.SelectedIndexChanged += new EventHandler(_thumbnailViewer_SelectedIndexChanged); } #if DEBUG if (!HaveImageCollectionOnThisComputer) { return; } //when just testing, I just want to see some choices. // _searchTermsBox.Text = @"flower"; _searchButton_Click(this, null); #endif _messageLabel.BackColor = Color.White; }
public void Setup() { _artCollection = new Palaso.UI.WindowsForms.ImageGallery.ArtOfReadingImageCollection(); _artCollection.LoadIndex(IndexPath); }