Esempio n. 1
0
        static void Main(string[] args)
        {
            if (args.Length > 0 && File.Exists(args[0]))
            {
                string batchOptFile = args[0];

                BatchOptionBase <ReplaceOption> bo = ObjSerializer.Load <BatchOptionBase <ReplaceOption> >(batchOptFile);
                BatchTextReplacer batchPro         = new BatchTextReplacer(bo);
                batchPro.Start();
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new TextProcessorForm());
            }
        }
Esempio n. 2
0
        private void OnBatchReplaceOperation(object sender, EventArgs e)
        {
            BatchOptionBase <ReplaceOption> bo = ObjSerializer.Load <BatchOptionBase <ReplaceOption> >(BatchConfigFile);

            _batchOptDlg = new OptionsDlg();
            _batchOptDlg.AddOption(bo);

            if (_batchOptDlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            ObjSerializer.Save(BatchConfigFile, bo);
            BatchTextReplacer batchPro = new BatchTextReplacer(bo);

            batchPro.Start();
        }