/// <summary> /// call when searches ended. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The e.</param> private void searchMethod_SearchEnded(object sender, SearchMethodsArgs e) { this.shouldEnable--; new Log(string.Format("end of searching drive {0}", e.DriveLetter)).EndOfLog(e.DriveLetter); if (SearchResults == null) { this.SearchResults = e.SearchResult.ToList(); } else { this.SearchResults.AddRange(e.SearchResult); } if (this.shouldEnable == 0) { new Log("end of all searchs").EndOfLog("startingsearchs"); Dispatcher.Invoke(() => { this.btnCancle.IsEnabled = true; this.btnSearch.IsEnabled = true; this.btnSave.IsEnabled = true; }); } }
/// <summary> /// call when searches started. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The e.</param> private void searchMethod_SearchStarted(object sender, SearchMethodsArgs e) { new Log(string.Format("start searching drive {0}", e.DriveLetter), true, e.DriveLetter); this.shouldEnable++; Dispatcher.Invoke(() => { this.btnCancle.IsEnabled = false; this.btnSearch.IsEnabled = false; this.btnSave.IsEnabled = false; }); }
/// <summary> /// Searches the ended fire. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The e.</param> private void SearchEndedFire(object sender, SearchMethodsArgs e) { if (this.SearchEnded != null) { this.SearchEnded(sender, e); } }