private void ChangeScreen() { if (InputValid()) { if (NameChanged() || InputChanged()) { TrimInput(); if (ScreenCollection.GetByName(textBoxScreenName.Text) != null && NameChanged()) { MessageBox.Show("A screen with this name already exists.", "Duplicate Name Conflict", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { ScreenCollection.Get(ScreenObject).Name = textBoxScreenName.Text; ScreenCollection.Get(ScreenObject).Folder = _fileSystem.CorrectScreenshotsFolderPath(textBoxFolder.Text); ScreenCollection.Get(ScreenObject).Macro = textBoxMacro.Text; ScreenCollection.Get(ScreenObject).Component = comboBoxScreenComponent.SelectedIndex; ScreenCollection.Get(ScreenObject).Format = ImageFormatCollection.GetByName(comboBoxFormat.Text); ScreenCollection.Get(ScreenObject).JpegQuality = (int)numericUpDownJpegQuality.Value; ScreenCollection.Get(ScreenObject).Mouse = checkBoxMouse.Checked; ScreenCollection.Get(ScreenObject).Enable = checkBoxEnable.Checked; ScreenCollection.Get(ScreenObject).X = (int)numericUpDownX.Value; ScreenCollection.Get(ScreenObject).Y = (int)numericUpDownY.Value; ScreenCollection.Get(ScreenObject).Width = (int)numericUpDownWidth.Value; ScreenCollection.Get(ScreenObject).Height = (int)numericUpDownHeight.Value; ScreenCollection.Get(ScreenObject).Source = comboBoxScreenSource.SelectedIndex; ScreenCollection.Get(ScreenObject).AutoAdapt = checkBoxAutoAdapt.Checked; ScreenCollection.Get(ScreenObject).CaptureMethod = comboBoxScreenCaptureMethod.SelectedIndex; ScreenCollection.Get(ScreenObject).Encrypt = checkBoxEncrypt.Checked; ScreenCollection.Get(ScreenObject).ResolutionRatio = (int)numericUpDownResolutionRatio.Value; Okay(); } } else { Close(); } } else { MessageBox.Show("Please enter valid input for each field.", "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ChangeScreen() { if (InputValid()) { //if (Directory.Exists(textBoxScreenFolder.Text)) //{ if (NameChanged() || InputChanged()) { TrimInput(); if (ScreenCollection.GetByName(textBoxName.Text) != null && NameChanged()) { MessageBox.Show("A screen with this name already exists.", "Duplicate Name Conflict", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { ScreenCollection.Get(ScreenObject).Name = textBoxName.Text; ScreenCollection.Get(ScreenObject).Folder = FileSystem.CorrectDirectoryPath(textBoxFolder.Text); ScreenCollection.Get(ScreenObject).Macro = textBoxMacro.Text; ScreenCollection.Get(ScreenObject).Component = comboBoxScreenComponent.SelectedIndex; ScreenCollection.Get(ScreenObject).Format = ImageFormatCollection.GetByName(comboBoxFormat.Text); ScreenCollection.Get(ScreenObject).JpegQuality = (int)numericUpDownJpegQuality.Value; ScreenCollection.Get(ScreenObject).ResolutionRatio = (int)numericUpDownResolutionRatio.Value; ScreenCollection.Get(ScreenObject).Mouse = checkBoxMouse.Checked; Okay(); } } else { Close(); } //} //else //{ //} } else { MessageBox.Show("Please enter valid input for each field.", "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Error); } }