private void LoadImagesFromDirectory(string path) { lstCaptionedImages.Items.Clear(); string[] files = Directory.GetFiles(path); Captions _caption = new Captions(); foreach (var file in files) { string extension = Path.GetExtension(file); if (extension.Equals(".jpg") || extension.Equals(".jpeg")) { string caption = _caption.GetNextCaption(); CaptionedImage ci = new CaptionedImage(file, caption); lstCaptionedImages.Items.Add(ci); } } }
private void captionsToolStripMenuItem_Click(object sender, EventArgs e) { _captionsScreen = new Captions(); _captionsScreen.Show(); }