Exemple #1
0
 public DeletionManager(StateSaveConcurrentQueue <string> queue, NetworkPorts ports,
                        ConcurrentDictionary <string, Peer> peers, ConcurrentDictionary <string, P2PFile> locations)
 {
     this._queue      = queue;
     this._ports      = ports;
     this._waitHandle = new ManualResetEvent(false);
     this._queue.ElementAddedToQueue += QueueElementAddedToQueue;
     this._filesList          = locations;
     Peer.PeerSwitchedOnline += PeerWentOnline;
     _fileDeleter             = new FileDeleter(peers, _ports);
 }
Exemple #2
0
        public UploadManager(StateSaveConcurrentQueue <P2PFile> queue, NetworkPorts ports,
                             ConcurrentDictionary <string, Peer> peers)
        {
            this._queue = queue;
            this._ports = ports;
            this._peers = peers;

            this._waitHandle = new ManualResetEvent(false);
            this._queue.ElementAddedToQueue += QueueElementAddedToQueue;
            _hiddenFolder = new HiddenFolder(_path + @".hidden");

            this._path = DiskHelper.GetRegistryValue("Path");
            Peer.PeerSwitchedOnline += PeerWentOnline;
        }
Exemple #3
0
        public DownloadManager(StateSaveConcurrentQueue <P2PFile> queue, NetworkPorts ports,
                               ConcurrentDictionary <string, Peer> peers, Index index)
        {
            this._queue      = queue;
            this._ports      = ports;
            this._peers      = peers;
            this._path       = DiskHelper.GetRegistryValue("Path");
            this._waitHandle = new ManualResetEvent(false);
            this._index      = index;
            this._queue.ElementAddedToQueue += QueueElementAddedToQueue;
            _ports.GetAvailablePort();
            this._fileDownloader = new FileDownloader(ports, _peers);


            Peer.PeerSwitchedOnline += PeerWentOnlineCheck;
        }