private void btnCountLetters_Click(object sender, EventArgs e) { //Clear the exisiting result txtResult.Text = string.Empty; textLibrary = new TextProcessingLibrary(); txtResult.Text = textLibrary.GetCharCount(txtToManipulate.Text); }
private void btnReverse_Click(object sender, EventArgs e) { textLibrary = new TextProcessingLibrary(); if (!string.IsNullOrEmpty(txtToManipulate.Text)) { //clear the result textbox txtResult.Text = string.Empty; txtResult.Text = textLibrary.ReverseText(txtToManipulate.Text); } }
private void btnSearch_Click(object sender, EventArgs e) { TextProcessingLibrary library = new TextProcessingLibrary(); //Clear any existing results lstSearchResults.Items.Clear(); //Get the matches List <string> resultList = library.GetAllSearchMatches(txtFilePath.Text, txtSearchText.Text); foreach (var result in resultList) { lstSearchResults.Items.Add(result); } MessageBox.Show(string.Format($"There are {resultList.Count} matches.")); }