/// <summary> /// Clear the target files /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnClear_Click(object sender, EventArgs e) { lstFiles.Clear(); txtFiles.Clear(); HighLight hl = new HighLight(txtFiles); hl.Reset2Default(); }
/// <summary> /// Show the match result on tree. /// </summary> /// <param name="matches"></param> private void BindMatchTree(MatchCollection matches, Regex reg) { HighLight hl = new HighLight(txtInput); hl.Reset2Default(); treeMatch.Nodes.Clear(); foreach (Match match in matches) { hl.Highlight(match); TreeNode nodeMatch = treeMatch.Nodes.Add(match.Value); BindGroup(nodeMatch, match, reg); } }
/// <summary> /// Do File Replace /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOK_Click(object sender, EventArgs e) { HighLight hl = new HighLight(txtFiles); hl.Reset2Default(); if (txtFiles.Lines.Length == 0) { txtFiles_DoubleClick(sender, e); return; } if (string.IsNullOrEmpty(cmbPattern.Text)) { MessageBox.Show("Please select a pattern !"); return; } ReplaceTemplate pattern = patternLoader[cmbPattern.Text]; ReplaceFactory.ReplaceFiles(txtFiles.Lines, pattern, hl.Highlight); }