void ButtonStopClicked (object sender, EventArgs e) { lock (searchesInProgress) { if (searchesInProgress.Count == 0) return; ISearchProgressMonitor monitor = searchesInProgress[searchesInProgress.Count - 1]; monitor.AsyncOperation.Cancel (); } }