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 ChangeRegion() { if (InputValid()) { //if (Directory.Exists(textBoxRegionFolder.Text)) //{ if (NameChanged() || InputChanged()) { TrimInput(); if (RegionCollection.GetByName(textBoxName.Text) != null && NameChanged()) { MessageBox.Show("A region with this name already exists.", "Duplicate Name Conflict", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { RegionCollection.Get(RegionObject).Name = textBoxName.Text; RegionCollection.Get(RegionObject).Folder = FileSystem.CorrectDirectoryPath(textBoxFolder.Text); RegionCollection.Get(RegionObject).Macro = textBoxMacro.Text; RegionCollection.Get(RegionObject).Format = ImageFormatCollection.GetByName(comboBoxFormat.Text); RegionCollection.Get(RegionObject).JpegQuality = (int)numericUpDownJpegQuality.Value; RegionCollection.Get(RegionObject).ResolutionRatio = (int)numericUpDownResolutionRatio.Value; RegionCollection.Get(RegionObject).Mouse = checkBoxMouse.Checked; RegionCollection.Get(RegionObject).X = (int)numericUpDownX.Value; RegionCollection.Get(RegionObject).Y = (int)numericUpDownY.Value; RegionCollection.Get(RegionObject).Width = (int)numericUpDownWidth.Value; RegionCollection.Get(RegionObject).Height = (int)numericUpDownHeight.Value; Okay(); } } else { Close(); } //} //else //{ // MessageBox.Show("The specified folder does not exist.", "Folder Does Not Exist", MessageBoxButtons.OK, MessageBoxIcon.Error); //} } else { MessageBox.Show("Please enter valid input for each field.", "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ChangeRegion() { if (InputValid()) { if (NameChanged() || InputChanged()) { TrimInput(); if (RegionCollection.GetByName(textBoxName.Text) != null && NameChanged()) { MessageBox.Show("A region with this name already exists.", "Duplicate Name Conflict", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { RegionCollection.Get(RegionObject).Name = textBoxName.Text; RegionCollection.Get(RegionObject).Folder = FileSystem.CorrectScreenshotsFolderPath(textBoxFolder.Text); RegionCollection.Get(RegionObject).Macro = textBoxMacro.Text; RegionCollection.Get(RegionObject).Format = ImageFormatCollection.GetByName(comboBoxFormat.Text); RegionCollection.Get(RegionObject).JpegQuality = (int)numericUpDownJpegQuality.Value; RegionCollection.Get(RegionObject).ResolutionRatio = (int)numericUpDownResolutionRatio.Value; RegionCollection.Get(RegionObject).Mouse = checkBoxMouse.Checked; RegionCollection.Get(RegionObject).X = (int)numericUpDownX.Value; RegionCollection.Get(RegionObject).Y = (int)numericUpDownY.Value; RegionCollection.Get(RegionObject).Width = (int)numericUpDownWidth.Value; RegionCollection.Get(RegionObject).Height = (int)numericUpDownHeight.Value; RegionCollection.Get(RegionObject).Active = checkBoxActive.Checked; RegionCollection.Get(RegionObject).ActiveWindowTitleCaptureCheck = checkBoxActiveWindowTitle.Checked; RegionCollection.Get(RegionObject).ActiveWindowTitleCaptureText = textBoxActiveWindowTitle.Text; Okay(); } } else { Close(); } } 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); } }