/// <summary> /// This event is fired when the <see cref="TextSearcherAndReplacer"/> class instance reports internal progress. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">The <see cref="T:VPKSoft.SearchText.TextSearcherEventArgs" /> instance containing the event data.</param> public void SearchOpenDocuments_SearchProgress(object sender, TextSearcherEventArgs e) { // as this event is fired from another thread, do invoke.. pbMain.Invoke(new MethodInvoker(delegate { // ..set the progress bar value to the value given from the TextSearcherAndReplacer class instance.. pbMain.Value = e.Percentage; })); }
/// <summary> /// Handles the SearchProgress event of the SearchOpenDocuments control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="TextSearcherEventArgs"/> instance containing the event data.</param> private void SearchOpenDocuments_SearchProgress(object sender, TextSearcherEventArgs e) { // invocation is required as this is coming from another thread.. pbMain.Invoke(new MethodInvoker(delegate { pbMain.Value = e.Percentage; })); lbProgressDesc.Invoke(new MethodInvoker(delegate { lbProgressDesc.Text = DBLangEngine.GetMessage("msgSearchProgress", "File: {0}, Progress: {1}|A message describing a search or replace progress with a file name and a progress percentage", e.FileName, e.Percentage); })); }