Beispiel #1
0
        /// Remove file from Download Manager
        public static void Remove(FileReceiver fileReceiver)
        {
            fileReceiver.Save();
            RemoveFileReceiver(fileReceiver.Peer, fileReceiver.FileName);
            numDownloads--;

            // Start Finished File Event
            if (Finished != null)
            {
                Finished(fileReceiver);
            }
        }
        /// Save and Remove Download From Receiving List
        public static void FinishedDownload(PeerSocket peer, ulong id)
        {
            FileReceiver fileRecv = new FileReceiver(id);

            fileRecv = (FileReceiver)recvList.Search(peer, fileRecv);
            fileRecv.Save();
            fileRecv.EndAbort -= new BlankEventHandler(OnEndAbort);
            recvList.Remove(peer, fileRecv);

            // Update Num Downloads
            numDownloads--;

            // Raise Finished Event
            if (Finished != null)
            {
                Finished(fileRecv);
            }
        }