public void StopSearching(SearchEndReason reason = SearchEndReason.Aborted) { if (tvSearchSocket != null) { Cleanup(); } if (tvSearchRetryTimer != null) { tvSearchRetryTimer.Dispose(); tvSearchRetryTimer = null; } if (tvSearchTimeoutTimer != null) { tvSearchTimeoutTimer.Dispose(); } if (SearchingEnded != null) { SearchingEnded(reason); } searchState = SearchState.SearchingCompleted; }
public void StopSearching(SearchEndReason reason = SearchEndReason.Aborted) { if (tvSearchSocket != null) { Cleanup(); } if (tvSearchRetryTimer != null) { tvSearchRetryTimer.Dispose(); tvSearchRetryTimer = null; } if (tvSearchTimeoutTimer != null) { tvSearchTimeoutTimer.Dispose(); } if (SearchingEnded != null) { SearchingEnded(reason); } searchState = SearchState.SearchingCompleted; }