private void AddNewScreen() { if (InputValid()) { TrimInput(); if (ScreenCollection.GetByName(textBoxName.Text) == null) { ScreenCollection.Add(new Screen( textBoxName.Text, FileSystem.CorrectDirectoryPath(textBoxFolder.Text), textBoxMacro.Text, comboBoxScreenComponent.SelectedIndex, ImageFormatCollection.GetByName(comboBoxFormat.Text), (int)numericUpDownJpegQuality.Value, (int)numericUpDownResolutionRatio.Value, checkBoxMouse.Checked)); Okay(); } else { MessageBox.Show("A screen with this name already exists.", "Duplicate Name Conflict", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Please enter valid input for each field.", "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
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); } }
private void AddScreen() { if (InputValid()) { TrimInput(); if (ScreenCollection.GetByName(textBoxScreenName.Text) == null) { ScreenCollection.Add(new Screen() { ViewId = Guid.NewGuid(), Name = textBoxScreenName.Text, Folder = _fileSystem.CorrectScreenshotsFolderPath(textBoxFolder.Text), Macro = textBoxMacro.Text, Component = comboBoxScreenComponent.SelectedIndex, Format = ImageFormatCollection.GetByName(comboBoxFormat.Text), JpegQuality = (int)numericUpDownJpegQuality.Value, Mouse = checkBoxMouse.Checked, Enable = checkBoxEnable.Checked, X = (int)numericUpDownX.Value, Y = (int)numericUpDownY.Value, Width = (int)numericUpDownWidth.Value, Height = (int)numericUpDownHeight.Value, Source = comboBoxScreenSource.SelectedIndex, AutoAdapt = checkBoxAutoAdapt.Checked, CaptureMethod = comboBoxScreenCaptureMethod.SelectedIndex, Encrypt = checkBoxEncrypt.Checked, ResolutionRatio = (int)numericUpDownResolutionRatio.Value }); Okay(); } else { MessageBox.Show("A screen with this name already exists.", "Duplicate Name Conflict", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Please enter valid input for each field.", "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void AddNewScreen() { if (InputValid()) { TrimInput(); if (ScreenCollection.GetByName(textBoxName.Text) == null) { ScreenCollection.Add(new Screen() { Name = textBoxName.Text, Folder = FileSystem.CorrectScreenshotsFolderPath(textBoxFolder.Text), Macro = textBoxMacro.Text, Component = comboBoxScreenComponent.SelectedIndex, Format = ImageFormatCollection.GetByName(comboBoxFormat.Text), JpegQuality = (int)numericUpDownJpegQuality.Value, ResolutionRatio = (int)numericUpDownResolutionRatio.Value, Mouse = checkBoxMouse.Checked, Active = checkBoxActive.Checked, ActiveWindowTitleCaptureCheck = checkBoxActiveWindowTitle.Checked, ActiveWindowTitleCaptureText = textBoxActiveWindowTitle.Text }); Okay(); } else { MessageBox.Show("A screen with this name already exists.", "Duplicate Name Conflict", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Please enter valid input for each field.", "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Error); } }