private static void EmitDownloadEvent(DownloadEventHandler handler, DownloadEventArgs args) { if (handler != null) { handler(null, args); } }
protected virtual void OnFinished() { DownloadEventHandler handler = Finished; if (handler != null) { handler(this, new DownloadEventArgs(dif)); } }
protected virtual void OnStart() { DownloadEventHandler handler = Started; if (handler != null) { handler(this, new DownloadEventArgs(dif)); } }
protected virtual void OnDownloadStateChanged(DownloadEventHandler handler, DownloadEventArgs args) { DownloadEventHandler local_handler = handler; if (local_handler != null) { local_handler(this, args); } }
public Updater(MainViewModel mainView, DownloadEventHandler onDownloadStart, DownloadEventHandler onDownloading, DownloadEventHandler onDownloadCompleted, DownloadErrorEventHandler onError) { _mainView = mainView; _dlClient = new DownloaderClient(); _dlClient.OnDownloadStart += onDownloadStart; _dlClient.OnDownloading += onDownloading; _dlClient.OnDownloadCompleted += onDownloadCompleted; _dlClient.OnError += onError; }
protected virtual void OnStop() { if (dif.State == DownloadState.CancelRequested) { dif.State = DownloadState.Canceled; try { if (File.Exists(TempFilePath)) { File.Delete(TempFilePath); DeleteTempDirectory(); DeleteDirectory(); } } catch {} } else if (dif.State == DownloadState.Completed) { try { if (File.Exists(TempFilePath)) { CreateDirectory(); HandleExistingFile(); File.Move(TempFilePath, FilePath); DeleteTempDirectory(); } } catch {} } else if (dif.State == DownloadState.Queued) { dif.State = DownloadState.Ready; } DownloadEventHandler handler = Stopped; if (handler != null) { handler(this, new DownloadEventArgs(dif)); } if (!dif.Active) { OnFinished(); } }
public void RegisterForDownloadNotification(DownloadEventHandler eventHandler, DownloadEventProgressHandler progressHandler, EventHandler allPendingHandler) { return; throw new NotImplementedException(); }
public void Download(IList items, EDownloadFlags eDownloadFlags, string deviceEndpointId, EDownloadContextEvent clientContextEvent, string clientContextEventData, DownloadEventHandler eventHandler, DownloadEventProgressHandler progressHandler, EventHandler allPendingHandler) { throw new NotImplementedException(); }
private static void EmitDownloadEvent(DownloadEventHandler handler, DownloadEventArgs args) { if (handler != null) { handler (null, args); } }
protected virtual void OnDownloadStateChanged(DownloadEventHandler handler, DownloadEventArgs args) { DownloadEventHandler local_handler = handler; if (local_handler != null) { local_handler (this, args); } }