Example #1
0
 private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox2.SelectedItem.ToString() != "")
     {
         try
         {
             VirtualSystem.Load(comboBox2.SelectedItem.ToString() + ".xml");
             label3.Text      = VirtualSystem.Name;
             label4.Text      = "Number of digital sensors: " + VirtualSystem.NumberOfDigitalSensors.ToString();
             label5.Text      = "Number of digital actuators: " + VirtualSystem.NumberOfDigitalActuators.ToString();
             label6.Text      = "Description:";
             textBox2.Text    = VirtualSystem.Description;
             textBox2.Visible = true;
             pictureBox5.Size = new System.Drawing.Size(VirtualSystem.picture.Width, VirtualSystem.picture.Height);
             Bitmap bmp = new Bitmap(VirtualSystem.picture.FilePath);
             this.pictureBox5.Image = (System.Drawing.Image)bmp;
         }
         catch (ArgumentException ae)
         {
             MessageBox.Show("Brak pliku z podglÄ…dowym obrazkiem");
         }
         catch (FileNotFoundException fsince)
         {
             MessageBox.Show(fsince.Message);
         }
         catch (Devices.FileStructIsNotCorectException fsince)
         {
             MessageBox.Show(fsince.Message);
         }
     }
 }