public override void Activate() { base.Activate(); _imageCollection = ArtOfReadingImageCollection.FromStandardLocations(); if (_imageCollection == null) { throw new ConfigurationException("Could not locate image index."); } }
public void FromStandardLocations_NoArtOfReadingInstalled_Null() { try { ArtOfReadingImageCollection.DoNotFindArtOfReading_Test = true; Assert.IsNull(ArtOfReadingImageCollection.FromStandardLocations()); } finally { ArtOfReadingImageCollection.DoNotFindArtOfReading_Test = false; } }
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; }