private void attachDownload(ArchiveDownloadRequest <TModel> request) { if (attachedRequest != null) { attachedRequest.Failure -= onRequestFailure; attachedRequest.DownloadProgressed -= onRequestProgress; attachedRequest.Success -= onRequestSuccess; } attachedRequest = request; if (attachedRequest != null) { if (attachedRequest.Progress == 1) { State.Value = DownloadState.Importing; Progress.Value = 1; } else { State.Value = DownloadState.Downloading; Progress.Value = attachedRequest.Progress; attachedRequest.Failure += onRequestFailure; attachedRequest.DownloadProgressed += onRequestProgress; attachedRequest.Success += onRequestSuccess; } } else { State.Value = DownloadState.NotDownloaded; } }
private void attachDownload(ArchiveDownloadRequest <IScoreInfo>?request) { if (attachedRequest != null) { attachedRequest.Failure -= onRequestFailure; attachedRequest.DownloadProgressed -= onRequestProgress; attachedRequest.Success -= onRequestSuccess; } attachedRequest = request; if (attachedRequest != null) { if (attachedRequest.Progress == 1) { UpdateProgress(1); UpdateState(DownloadState.Importing); } else { UpdateProgress(attachedRequest.Progress); UpdateState(DownloadState.Downloading); attachedRequest.Failure += onRequestFailure; attachedRequest.DownloadProgressed += onRequestProgress; attachedRequest.Success += onRequestSuccess; } } else { UpdateState(DownloadState.NotDownloaded); } }
private void downloadFailed(ArchiveDownloadRequest <IScoreInfo> request) => Schedule(() => { if (checkEquality(request.Model, TrackedItem)) { attachDownload(null); } });
private void downloadFailed(ArchiveDownloadRequest <TModel> request) => Schedule(() => { if (request.Model.Equals(Model.Value)) { attachDownload(null); } });
private void downloadBegan(ArchiveDownloadRequest <TModel> request) { if (request.Model.Equals(Model.Value)) { attachDownload(request); } }
private void downloadBegan(ArchiveDownloadRequest <IBeatmapSetInfo> request) => Schedule(() => { if (checkEquality(request.Model, TrackedItem)) { attachDownload(request); } });