Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (_settingsController != null)
            {
                var result = _settingsController.ApplyClicked();
                if (!string.IsNullOrWhiteSpace(result))
                {
                    MessageBox.Show(result, "WallApp", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }

            LayerSettings.Name        = textBox1.Text;
            LayerSettings.Description = textBox2.Text;
            LayerSettings.Enabled     = checkBox3.Checked;

            LayerSettings.Dimensions.MonitorName    = comboBox1.SelectedItem.ToString();
            LayerSettings.Dimensions.AbsoluteValues = checkBox1.Checked;
            LayerSettings.Dimensions.MarginValues   = checkBox2.Checked;

            LayerSettings.Dimensions.XValue = (int)numericUpDown1.Value;
            LayerSettings.Dimensions.YValue = (int)numericUpDown2.Value;
            LayerSettings.Dimensions.ZValue = (int)numericUpDown3.Value;
            LayerSettings.Dimensions.WValue = (int)numericUpDown4.Value;

            LayerSettings.Rotation = (int)numericUpDown5.Value;

            LayerSettings.TintColor = new Microsoft.Xna.Framework.Color(pictureBox1.BackColor.R, pictureBox1.BackColor.G, pictureBox1.BackColor.B);
            LayerSettings.Effect    = comboBox2.SelectedIndex == 0 ? "" : comboBox2.SelectedItem.ToString();

            DialogResult = DialogResult.OK;
            Close();
        }