public void Init(ScreenShotImageConverter cf, string inputfolder, ScreenShotConverter.InputTypes it, string outputfolder) { comboBoxOutputAs.Items.AddRange(Enum.GetNames(typeof(ScreenShotImageConverter.OutputTypes))); comboBoxOutputAs.SelectedIndex = (int)cf.OutputFileExtension; comboBoxScanFor.Items.AddRange(Enum.GetNames(typeof(ScreenShotConverter.InputTypes))); comboBoxScanFor.SelectedIndex = (int)it; initialssfolder = textBoxScreenshotsDir.Text = inputfolder; textBoxOutputDir.Text = outputfolder; comboBoxSubFolder.Items.AddRange(ScreenShotImageConverter.SubFolderSelections); comboBoxSubFolder.SelectedIndex = cf.FolderNameFormat; comboBoxFileNameFormat.Items.AddRange(ScreenShotImageConverter.FileNameFormats); comboBoxFileNameFormat.SelectedIndex = cf.FileNameFormat; string[] opt = new string[] { "Off", "Crop", "Resize" }; extComboBoxConvert1.Items.AddRange(opt); extComboBoxConvert2.Items.AddRange(opt); extCheckBoxHiRes.Checked = cf.HighRes; extCheckBoxCopyClip.Checked = cf.CopyToClipboard; extComboBoxConvert1.SelectedIndex = (int)cf.CropResizeImage1; extComboBoxConvert2.SelectedIndex = (int)cf.CropResizeImage2; extCheckBoxRemoveOriginal.Checked = cf.RemoveOriginal; extCheckBoxKeepMasterConvertedImage.Checked = cf.KeepMasterConvertedImage; numericUpDownTop1.Value = cf.CropResizeArea1.Top; numericUpDownLeft1.Value = cf.CropResizeArea1.Left; numericUpDownWidth1.Value = cf.CropResizeArea1.Width; numericUpDownHeight1.Value = cf.CropResizeArea1.Height; extNumericUpDownTop2.Value = cf.CropResizeArea2.Top; extNumericUpDownLeft2.Value = cf.CropResizeArea2.Left; extNumericUpDownWidth2.Value = cf.CropResizeArea2.Width; extNumericUpDownHeight2.Value = cf.CropResizeArea2.Height; SetNumEnabled(); extComboBoxConvert1.SelectedIndexChanged += (s, e) => { SetNumEnabled(); }; extComboBoxConvert2.SelectedIndexChanged += (s, e) => { SetNumEnabled(); }; textBoxFileNameExample.Text = ScreenShotImageConverter.CreateFileName("Sol", "Earth", "HighResScreenshot_0000.bmp", comboBoxFileNameFormat.SelectedIndex, extCheckBoxHiRes.Checked, DateTime.Now); BaseUtils.Translator.Instance.Translate(this); label_index.Text = this.Text; }
public void Init(ScreenShotImageConverter cf, bool enabled, string inputfolder, ScreenShotConverter.InputTypes it, string outputfolder) { comboBoxFileNameFormat.Items.AddRange(ScreenShotImageConverter.FileNameFormats); comboBoxFileNameFormat.SelectedIndex = cf.FileNameFormat; extCheckBoxEnabled.Checked = enabled; comboBoxOutputAs.Items.AddRange(Enum.GetNames(typeof(ScreenShotImageConverter.OutputTypes))); comboBoxOutputAs.SelectedIndex = (int)cf.OutputFileExtension; comboBoxScanFor.Items.AddRange(Enum.GetNames(typeof(ScreenShotConverter.InputTypes))); comboBoxScanFor.SelectedIndex = (int)it; initialssfolder = textBoxScreenshotsDir.Text = inputfolder; textBoxOutputDir.Text = outputfolder; comboBoxSubFolder.Items.AddRange(ScreenShotImageConverter.SubFolderSelections); comboBoxSubFolder.SelectedIndex = cf.FolderNameFormat; string[] opt = new string[] { "Off", "Crop", "Resize" }; extComboBoxConvert1.Items.AddRange(opt); extComboBoxConvert2.Items.AddRange(opt); extCheckBoxHiRes.Checked = cf.HighRes; extComboBoxClipboard.Items.Add(ScreenShotImageConverter.ClipboardOptions.NoCopy.ToString().SplitCapsWordFull()); extComboBoxClipboard.Items.Add(ScreenShotImageConverter.ClipboardOptions.CopyMaster.ToString().SplitCapsWordFull()); extComboBoxClipboard.Items.Add(ScreenShotImageConverter.ClipboardOptions.CopyImage1.ToString().SplitCapsWordFull()); extComboBoxClipboard.Items.Add(ScreenShotImageConverter.ClipboardOptions.CopyImage2.ToString().SplitCapsWordFull()); extComboBoxClipboard.SelectedIndex = (int)cf.ClipboardOption; extComboBoxConvert1.SelectedIndex = (int)cf.CropResizeImage1; extComboBoxConvert2.SelectedIndex = (int)cf.CropResizeImage2; OriginalImageDirectory = cf.OriginalImageOptionDirectory; extComboBoxOriginalImageSel.Items.Add(ScreenShotImageConverter.OriginalImageOptions.Leave.ToString()); extComboBoxOriginalImageSel.Items.Add(ScreenShotImageConverter.OriginalImageOptions.Delete.ToString()); extComboBoxOriginalImageSel.Items.Add(ScreenShotImageConverter.OriginalImageOptions.Move.ToString() + "->" + OriginalImageDirectory); extComboBoxOriginalImageSel.SelectedIndex = (int)cf.OriginalImageOption; extCheckBoxKeepMasterConvertedImage.Checked = cf.KeepMasterConvertedImage; numericUpDownTop1.Value = cf.CropResizeArea1.Top; numericUpDownLeft1.Value = cf.CropResizeArea1.Left; numericUpDownWidth1.Value = cf.CropResizeArea1.Width; numericUpDownHeight1.Value = cf.CropResizeArea1.Height; extNumericUpDownTop2.Value = cf.CropResizeArea2.Top; extNumericUpDownLeft2.Value = cf.CropResizeArea2.Left; extNumericUpDownWidth2.Value = cf.CropResizeArea2.Width; extNumericUpDownHeight2.Value = cf.CropResizeArea2.Height; SetNumEnabled(); extComboBoxConvert1.SelectedIndexChanged += (s, e) => { SetNumEnabled(); }; extComboBoxConvert2.SelectedIndexChanged += (s, e) => { SetNumEnabled(); }; UpdateExample(); BaseUtils.Translator.Instance.Translate(this); label_index.Text = this.Text; }