コード例 #1
0
 public void Update(TorrentData td)
 {
     this.torrentProgress = td.torrentProgress;
     this.downSpeed       = td.DownloadSpeed;
     this.upSpeed         = td.upSpeed;
     this.eta             = td.eta;
     this.peers           = td.peers;
     this.seeds           = td.seeds;
     if (PropertyChanged != null)
     {
         PropertyChanged(this, new PropertyChangedEventArgs("TorrentProgress"));
         PropertyChanged(this, new PropertyChangedEventArgs("DownloadSpeed"));
         PropertyChanged(this, new PropertyChangedEventArgs("UploadSpeed"));
         PropertyChanged(this, new PropertyChangedEventArgs("ETA"));
     }
 }
コード例 #2
0
 private void TorrentReceived(TorrentInfo ti)
 {
     TorrentData td = new TorrentData(ti);
     int i;
     lock (torrents)
     {
         for (i = 0; i < torrents.Count; i++)
         {
             if (torrents[i].EqualsTorrent(td))
             {
                 torrents[i].Update(td);
                 break;
             }
         }
         if (i == torrents.Count)
             AddTorrent(td);
     }
 }
コード例 #3
0
ファイル: TorrentData.cs プロジェクト: ballance/MetroTorrent
 public void Update(TorrentData td)
 {
     this.torrentProgress = td.torrentProgress;
     this.downSpeed = td.DownloadSpeed;
     this.upSpeed = td.upSpeed;
     this.eta = td.eta;
     this.peers = td.peers;
     this.seeds = td.seeds;
     if (PropertyChanged != null)
     {
         PropertyChanged(this, new PropertyChangedEventArgs("TorrentProgress"));
         PropertyChanged(this, new PropertyChangedEventArgs("DownloadSpeed"));
         PropertyChanged(this, new PropertyChangedEventArgs("UploadSpeed"));
         PropertyChanged(this, new PropertyChangedEventArgs("ETA"));
     }
 }
コード例 #4
0
 public void AddTorrent(TorrentData torrent)
 {
     torrents.Add(torrent);
 }