Exemplo n.º 1
0
        private void addPicturesButton_Click(object sender, EventArgs e)
        {
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Hand;
            openFileDialog1.Multiselect         = true;
            DialogResult selectedItems = openFileDialog1.ShowDialog();

            string[] selectedImagesNames = openFileDialog1.FileNames;
            if (selectedItems == DialogResult.OK)
            {
                if (USEFULTOOLS.validateConversion(selectedImagesNames))
                {
                    OKButtonMenu.Enabled = true;
                    USEFULTOOLS.addImagesData(ref imagesNamesList, ref selectedImagesNames);
                }
                else
                {
                    MessageBox.Show("Sorry, but you accidentally chose a file whose extension is not an image.", "Problem detected", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 2
0
 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;
     }
 }