Beispiel #1
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            // apply setting to config
            currentLighting = editLighting;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Beispiel #2
0
 private void button5_Click(object sender, EventArgs e)
 {
     // load in lighting conf from file
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         LightingConf lighting = LightingConf.FromXmlFile(openFileDialog1.FileName, maxNumLights);
         if (lighting != null)
         {
             // add to list
             setupFilenames.Add(openFileDialog1.FileName);
             setups.Add(lighting);
             listBox2.Items.Add(Path.GetFileName(openFileDialog1.FileName));
         }
         else
         {
             MessageBox.Show(this, "Problem parsing lighting setup file", "Lighting Setup", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
     }
 }
Beispiel #3
0
        private void button6_Click(object sender, EventArgs e)
        {
            // load new setup into editor
            if (listBox2.SelectedIndex != -1)
            {
                if (changedEditing && MessageBox.Show(this, "Keep Changes to Setup?", "Setup Modified",
                                                      MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                    == DialogResult.Yes)
                {
                    // copy clone back over original setup
                    if (editIndex < 0)
                    {
                        currentLighting = editLighting;
                    }
                    else
                    {
                        setups[editIndex] = editLighting;
                        // save over existing setup file
                        editLighting.ToXmlFile((string)setupFilenames[editIndex]);
                    }
                }

                // copy clone into editor
                editIndex = listBox2.SelectedIndex - 1;
                if (editIndex < 0)
                {
                    editLighting = (LightingConf)currentLighting.Clone();
                }
                else
                {
                    editLighting = (LightingConf)((LightingConf)setups[editIndex]).Clone();
                }

                SetupLights();
                groupBox4.Text = "Lights Edit [" + (string)listBox2.SelectedItem + "]";
            }
        }
        private void button6_Click(object sender, EventArgs e)
        {
            // load new setup into editor
            if (listBox2.SelectedIndex != -1)
            {
                if (changedEditing && MessageBox.Show(this, "Keep Changes to Setup?", "Setup Modified",
                                                      MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                    == DialogResult.Yes)
                {
                    // copy clone back over original setup
                    if (editIndex < 0)
                        currentLighting = editLighting;
                    else
                    {
                        setups[editIndex] = editLighting;
                        // save over existing setup file
                        editLighting.ToXmlFile((string)setupFilenames[editIndex]);
                    }
                }

                // copy clone into editor
                editIndex = listBox2.SelectedIndex - 1;
                if (editIndex < 0)
                    editLighting = (LightingConf)currentLighting.Clone();
                else
                    editLighting = (LightingConf)((LightingConf)setups[editIndex]).Clone();

                SetupLights();
                groupBox4.Text = "Lights Edit [" + (string)listBox2.SelectedItem + "]";
            }
        }
		private void button1_Click(object sender, System.EventArgs e)
		{
			// apply setting to config
            currentLighting = editLighting;

			this.DialogResult = DialogResult.OK;
			this.Close();
		}