public static void addImagesData(ref ListBox imagesNamesList, ref string[] selectedImagesNames) { string imageName = ""; foreach (string i in selectedImagesNames) { if (imagesDataInList.ContainsKey(i) == false) { imageName = getImageName(i); IMAGEDATA temp = new IMAGEDATA(); temp.name = imageName; temp.location = i; imagesDataInList.Add(i, true); imagesNamesList.Items.Add(temp); } else { MessageBox.Show("image with this name \" " + getImageName(i) + " \" " + "is already exists.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
private void imagesNamesList_SelectedIndexChanged(object sender, EventArgs e) { if (imagesNamesList.SelectedIndex >= 0 && tabControl1.SelectedTab == ModePage3 && (statusBar1.Panels[1].Text != "Single picture Mode")) { OKPage3Button.Enabled = true; string imageName = ((IMAGEDATA)(imagesNamesList.SelectedItem)).location; if (USEFULTOOLS.imagesDataInDisplayList.ContainsKey(imageName) == false) { USEFULTOOLS.imagesDataInDisplayList.Add(imageName, true); IMAGEDATA temp = new IMAGEDATA(); temp.name = USEFULTOOLS.getImageName(imageName); temp.location = imageName; DisplayList.Items.Add(temp); } } else if (tabControl1.SelectedTab == menuPage1 && imagesNamesList.SelectedIndex >= 0) { deletPicturesButton.Enabled = true; } else if (tabControl1.SelectedTab == ModePage3 && (statusBar1.Panels[1].Text == "Single picture Mode") && imagesNamesList.SelectedIndex >= 0) { OKPage3Button.Enabled = true; } }