private void AddNewRegion() { if (InputValid()) { TrimInput(); if (RegionCollection.GetByName(textBoxName.Text) == null) { RegionCollection.Add(new Region( textBoxName.Text, FileSystem.CorrectDirectoryPath(textBoxFolder.Text), textBoxMacro.Text, ImageFormatCollection.GetByName(comboBoxFormat.Text), (int)numericUpDownJpegQuality.Value, (int)numericUpDownResolutionRatio.Value, checkBoxMouse.Checked, (int)numericUpDownX.Value, (int)numericUpDownY.Value, (int)numericUpDownWidth.Value, (int)numericUpDownHeight.Value)); Okay(); } else { MessageBox.Show("A region 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 AddNewRegion() { if (InputValid()) { TrimInput(); if (RegionCollection.GetByName(textBoxName.Text) == null) { RegionCollection.Add(new Region() { Name = textBoxName.Text, Folder = FileSystem.CorrectScreenshotsFolderPath(textBoxFolder.Text), Macro = textBoxMacro.Text, Format = ImageFormatCollection.GetByName(comboBoxFormat.Text), JpegQuality = (int)numericUpDownJpegQuality.Value, ResolutionRatio = (int)numericUpDownResolutionRatio.Value, Mouse = checkBoxMouse.Checked, X = (int)numericUpDownX.Value, Y = (int)numericUpDownY.Value, Width = (int)numericUpDownWidth.Value, Height = (int)numericUpDownHeight.Value, Active = checkBoxActive.Checked, ActiveWindowTitleCaptureCheck = checkBoxActiveWindowTitle.Checked, ActiveWindowTitleCaptureText = textBoxActiveWindowTitle.Text }); Okay(); } else { MessageBox.Show("A region 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 AddRegion() { if (InputValid()) { TrimInput(); if (RegionCollection.GetByName(textBoxRegionName.Text) == null) { RegionCollection.Add(new Region() { ViewId = Guid.NewGuid(), Name = textBoxRegionName.Text, Folder = _fileSystem.CorrectScreenshotsFolderPath(textBoxFolder.Text), Macro = textBoxMacro.Text, Format = ImageFormatCollection.GetByName(comboBoxFormat.Text), JpegQuality = (int)numericUpDownJpegQuality.Value, Mouse = checkBoxMouse.Checked, X = (int)numericUpDownX.Value, Y = (int)numericUpDownY.Value, Width = (int)numericUpDownWidth.Value, Height = (int)numericUpDownHeight.Value, Enable = checkBoxEnable.Checked, Encrypt = checkBoxEncrypt.Checked }); Okay(); } else { MessageBox.Show("A region 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); } }