void downloadHandler_OnDownloadNotify(DownloadNotifyEventArg e) { var item = downloadManager.GetByID(e.DownloadID); item.CurrLength += e.DataLength; e.IsCancel = item.IsCancel; }
public bool ReceivedData(byte[] data) { int dataLength = data.GetLength(0); var notifyEventArg = new DownloadNotifyEventArg(downloadID); notifyEventArg.DataLength = dataLength; downloadNotifyEventHandler(notifyEventArg); if (notifyEventArg.IsCancel) { CloseDownload(); return(false); } else { stream.Write(data, 0, dataLength); } return(true); }
public bool ReceivedData(byte[] data) { int dataLength = data.GetLength(0); var notifyEventArg = new DownloadNotifyEventArg(downloadID); notifyEventArg.DataLength = dataLength; downloadNotifyEventHandler(notifyEventArg); if (notifyEventArg.IsCancel) { CloseDownload(); return false; } else { stream.Write(data, 0, dataLength); } return true; }