private void CancelAllResult(String response) { try { CancelAllResultHandler?.Invoke(JsonRequest.GetResult(response).result.Equals("OK")); _downloadItems.Clear(); } catch (Exception e) { CancelAllResultHandler?.Invoke(false); ExceptionHelper.ShowErrorMsg("CancelAllResult", e); } }
private void CancelSingleResult(String response) { try { String gid = JsonRequest.GetResult(response).result; DownloadItem downloadItem = _downloadItems.First(item => item.GetGid.Equals(gid)); _downloadItems.Remove(downloadItem); CancelSingleResultHandler?.Invoke(downloadItem); } catch (Exception e) { CancelSingleResultHandler?.Invoke(null); ExceptionHelper.ShowErrorMsg("CancelSingleResult", e); } }
private void ShutDownResult(String response) { try { if (JsonRequest.GetResult(response).result.Equals("OK")) { _isListening = false; _webSocket.Abort(); _webSocket.Dispose(); } } catch (Exception e) { ExceptionHelper.ShowErrorMsg("ShutDownResult", e); } }