예제 #1
0
 public override void CreateNewImage()
 {
     FormAddImage f = new FormAddImage();
     f.ShowDialog();
     if (f.DialogResult == DialogResult.OK)
     {
         try
         {
             this.imgFact.AddImage(f.ImageTitle, f.ImageFile, null);
         }
         catch (Exception ex)
         {
             Debug.WriteLine(ex.Message);
             Debug.WriteLine(ex.StackTrace);
         }
     }
     f.Dispose();
 }
예제 #2
0
        private void newButton_Click(object sender, EventArgs e)
        {
            FormAddImage f = new FormAddImage();
            f.ShowDialog();
            if (f.DialogResult == DialogResult.OK)
            {
                try
                {
                    Image img = this.imgFact.AddImage(f.ImageTitle, f.ImageFile, null);
                    this.FillList();

                    foreach (Image imgLst in this.imagesBox.Items)
                    {
                        if (imgLst.Id == img.Id)
                        {
                            this.imagesBox.SelectedItem = imgLst;
                            break;
                        }
                    }

                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                    Debug.WriteLine(ex.StackTrace);
                }
            }
            f.Dispose();
        }
예제 #3
0
        private void NewButtonClick(object sender, EventArgs e)
        {
            FormAddImage faddImg = new FormAddImage();
            if (DialogResult.OK == faddImg.ShowDialog())
            {
                try
                {
                    Image img = this.imgFact.AddImage(faddImg.ImageTitle, faddImg.ImageFile, null);
                    this.FillImages();

                    foreach (Image imgLst in this.comboBox1.Items)
                    {
                        if (imgLst.Id == img.Id)
                        {
                            this.comboBox1.SelectedItem = imgLst;
                            break;
                        }
                    }
                }
                catch (Exception)
                {
                }
            }
        }