void DoFindBkgnd(object sender, DoWorkEventArgs eventArgs) { BackgroundWorker bw = sender as BackgroundWorker; try { Progress.ProgressUpdated += bw.ReportProgress; OperationFindOptions options = (_inclSubDir ? OperationFindOptions.IncludeSubDirectory : OperationFindOptions.None) | (_inclHiddenDir ? OperationFindOptions.IncludeHiddenDirectory : OperationFindOptions.None) | (_inclHiddenFile ? OperationFindOptions.IncludeHiddenFile : OperationFindOptions.None) | (_regEx ? OperationFindOptions.RegexEnabled : OperationFindOptions.None); OperationFind operationFind = new OperationFind( _dirPath, _pattern, _beforeText, options, JpnEncoding.NumberToJpnEncoding(_encNumber), _regExMultiline ? RegexOptions.Multiline : RegexOptions.Singleline, Progress); _fileListView = operationFind.ExecuteOperationFind(); } catch (Exception) { _fileListView.ListValid = false; throw; // RunWorkerCompleted event handler will be called } }
public MainForm() { InitializeComponent(); InitializeMainMenu(); AssemblyName assemblyName = Assembly.GetExecutingAssembly().GetName(); this.Text = "Hoge Text Replace " + assemblyName.Version.Major + "." + assemblyName.Version.Minor; this.Icon = global::HogeTextReplace.Properties.Resources.ProgramIcon; for (int i = 0; i <= JpnEncoding.MaxNumber; i++) { comboBoxEnc.Items.Add(JpnEncoding.NumberToJpnEncoding(i).Name); } comboBoxEnc.SelectedIndex = 0; cbRegEx_CheckedChanged(null, null); cbSubDir_CheckedChanged(null, null); cbSubDir_EnabledChanged(null, null); InclSubDirCheckBoxEnabled = (BackupArgs.Mode != BackupMode.SubFolder); // to avoid backup files found comboBoxNewline.Items.AddRange(eolCodes); comboBoxNewline.SelectedIndex = 0; LoadTextContent(); // from text_before.ini and text_after.ini azukiBefore.ScrollToCaret(); azukiAfter.ScrollToCaret(); azukiBefore.Document.ClearHistory(); azukiAfter.Document.ClearHistory(); iniFile = new IniForMainForm("config.ini", this); iniFile.LoadIni(); }