Exemplo n.º 1
0
        public void Configure(Form parent)
        {
            ScreenShotConfigureForm frm = new ScreenShotConfigureForm();

            frm.Init(converter, InputFolder, InputFileExtension, OutputFolder);

            if (frm.ShowDialog(parent) == DialogResult.OK)
            {
                if (watcher != null)
                {
                    watcher.Stop();
                }

                InputFolder                        = frm.InputFolder;
                OutputFolder                       = frm.OutputFolder;
                converter.RemoveOriginal           = frm.RemoveOriginal;
                InputFileExtension                 = frm.InputFileExtension;
                converter.OutputFileExtension      = frm.OutputFileExtension;
                converter.FolderNameFormat         = frm.FolderNameFormat;
                converter.FileNameFormat           = frm.FileNameFormat;
                converter.KeepMasterConvertedImage = frm.KeepMasterConvertedImage;
                converter.CropResizeImage1         = frm.CropResizeImage1;
                converter.CropResizeImage2         = frm.CropResizeImage2;
                converter.CropResizeArea1          = frm.CropResizeArea1;
                converter.CropResizeArea2          = frm.CropResizeArea2;
                converter.HighRes                  = frm.HighRes;
                converter.CopyToClipboard          = frm.CopyToClipboard;

                if (watcher != null)
                {
                    watcher.Start(InputFolder, InputFileExtension.ToString(), OutputFolder);
                }
            }
        }
        public bool Start(Action <Action> invokeOnUiThreadp, Action <string> logger,
                          Func <Tuple <string, string, string> > currentloccmdr, int watchdelaytime)
        {
            Stop();

            invokeOnUiThread = invokeOnUiThreadp;

            watcher = new ScreenshotDirectoryWatcher(CallWithConverter, logger, currentloccmdr, watchdelaytime); // pass function to get the convert going
            watcher.OnScreenshot += ConvertCompleted;                                                            // and function for it to call when its over..

            return(watcher.Start(InputFolder, InputFileExtension.ToString(), OutputFolder));                     // you can restart a watcher without stopping it..
        }
        public void Configure(Form parent)
        {
            ScreenShotConfigureForm frm = new ScreenShotConfigureForm();

            frm.Init(converter, AutoConvert, InputFolder, InputFileExtension, OutputFolder);

            if (frm.ShowDialog(parent) == DialogResult.OK)
            {
                if (watcher != null)
                {
                    watcher.Stop();
                }

                AutoConvert  = frm.AutoConvert;
                InputFolder  = frm.InputFolder;
                OutputFolder = frm.OutputFolder;
                converter.OriginalImageOption          = frm.OriginalImageOption;
                converter.OriginalImageOptionDirectory = frm.OriginalImageDirectory;
                InputFileExtension                 = frm.InputFileExtension;
                converter.OutputFileExtension      = frm.OutputFileExtension;
                converter.FolderNameFormat         = frm.FolderNameFormat;
                converter.FileNameFormat           = frm.FileNameFormat;
                converter.KeepMasterConvertedImage = frm.KeepMasterConvertedImage;
                converter.CropResizeImage1         = frm.CropResizeImage1;
                converter.CropResizeImage2         = frm.CropResizeImage2;
                converter.CropResizeArea1          = frm.CropResizeArea1;
                converter.CropResizeArea2          = frm.CropResizeArea2;
                converter.HighRes         = frm.HighRes;
                converter.ClipboardOption = frm.ClipboardOption;
                converter.Quality         = frm.Quality;

                if (watcher != null)
                {
                    watcher.Start(InputFolder, InputFileExtension.ToString(), OutputFolder);
                }
            }
        }