protected virtual void OnBytesRead(int bytesMoved) { if (BytesRead != null) { var args = new ProgressStreamReportEventArgs(bytesMoved, _innerStream.Length, _innerStream.Position, true); BytesRead(this, args); } }
protected virtual void OnBytesWritten(int bytesMoved) { if (BytesWritten != null) { long length = 0; try { length = _innerStream.Length; } catch { } var args = new ProgressStreamReportEventArgs(bytesMoved, length, _innerStream.Position, false); BytesWritten(this, args); } }