public override bool Equals(object obj) { BlockEventArgs args = obj as BlockEventArgs; return((args == null) ? false : this.piece.Equals(args.piece) && this.id.Equals(args.id) && this.block.Equals(args.block)); }
internal void RaiseBlockRequestCancelled(BlockEventArgs args) { BlockRequestCancelled?.InvokeAsync(args.TorrentManager, args); }
internal void RaiseBlockReceived(BlockEventArgs args) { BlockReceived?.InvokeAsync(args.TorrentManager, args); }
internal void RaiseBlockRequestCancelled(BlockEventArgs args) { Toolbox.RaiseAsyncEvent <BlockEventArgs>(BlockRequestCancelled, args.TorrentManager, args); }
public BlockProgressBar(BlockEventArgs piece) { this.args = piece; }
internal void RaiseBlockRequestCancelled(BlockEventArgs args) { Toolbox.RaiseAsyncEvent<BlockEventArgs>(BlockRequestCancelled, args.TorrentManager, args); }
void PieceManager_BlockReceived(object sender, BlockEventArgs e) { if (RecievedPieces == null) { RecievedPieces = new bool[Torrent.Torrent.Pieces.Count]; for (int i = 0; i < RecievedPieces.Length; i++) RecievedPieces[i] = false; } RecievedPieces[e.Piece.Index] = true; if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("RecievedPieces")); }
internal void RaiseBlockReceived(BlockEventArgs args) { Toolbox.RaiseAsyncEvent(BlockReceived, args.TorrentManager, args); }
internal void RaiseBlockWritten(BlockEventArgs args) { Toolbox.RaiseAsyncEvent<BlockEventArgs>(BlockWritten, this.manager, args); }
private void OnBlockRequested (object sender, BlockEventArgs args) { // add a requested piece foreach (BlockEventArgs blockEvent in pieces) { if (blockEvent.Piece == args.Piece) return; } if(args.Piece.AllBlocksWritten) return; pieces.Add(args); }
private void PieceManager_BlockReceived(object sender, BlockEventArgs e) { var progg = e.TorrentManager.Progress; }
void FileManager_BlockWritten(object sender, BlockEventArgs e) { // Do nothing - currently everything handled on the GUI update }
void PieceManager_BlockReceived(object sender, BlockEventArgs e) { // Do nothing - currently everything handled on the GUI update }
void PieceManager_BlockRequested(object sender, BlockEventArgs e) { lock (currentRequests) { bool contains = false; for (int i = 0; i < currentRequests.Count; i++) if (currentRequests[i].Piece.Equals(e.Piece)) { contains = true; break; } if (!contains && !e.Piece.AllBlocksWritten) currentRequests.Add(e); } }