예제 #1
0
        void downloadHandler_OnDownloadNotify(DownloadNotifyEventArg e)
        {
            var item = downloadManager.GetByID(e.DownloadID);

            item.CurrLength += e.DataLength;

            e.IsCancel = item.IsCancel;
        }
예제 #2
0
        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);
        }
예제 #3
0
        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;
        }
예제 #4
0
        void downloadHandler_OnDownloadNotify(DownloadNotifyEventArg e)
        {
            var item = downloadManager.GetByID(e.DownloadID);
            item.CurrLength += e.DataLength;

            e.IsCancel = item.IsCancel;
        }