public static Transfer FromSoulseekTransfer(Soulseek.Transfer transfer) { return(new Transfer() { AverageSpeed = transfer.AverageSpeed, BytesRemaining = transfer.BytesRemaining, BytesTransferred = transfer.BytesTransferred, Direction = transfer.Direction, ElapsedTime = transfer.ElapsedTime?.TotalMilliseconds, EndTime = transfer.EndTime, Filename = transfer.Filename, IPEndPoint = transfer.IPEndPoint, PercentComplete = transfer.PercentComplete, RemainingTime = transfer.RemainingTime?.TotalMilliseconds, RemoteToken = transfer.RemoteToken, Size = transfer.Size, StartOffset = transfer.StartOffset, StartTime = transfer.StartTime, State = transfer.State, Token = transfer.Token, Username = transfer.Username }); }
/// <summary> /// Initializes a new instance of the <see cref="TransferProgressUpdatedEventArgs"/> class. /// </summary> /// <param name="previousBytesTransferred">The previous total number of bytes transferred.</param> /// <param name="transfer">The transfer which raised the event.</param> internal TransferProgressUpdatedEventArgs(long previousBytesTransferred, Transfer transfer) : base(transfer) { PreviousBytesTransferred = previousBytesTransferred; }
/// <summary> /// Initializes a new instance of the <see cref="TransferStateChangedEventArgs"/> class. /// </summary> /// <param name="previousState">The previous state of the transfer.</param> /// <param name="transfer">The transfer which raised the event.</param> internal TransferStateChangedEventArgs(TransferStates previousState, Transfer transfer) : base(transfer) { PreviousState = previousState; }
/// <summary> /// Initializes a new instance of the <see cref="TransferEventArgs"/> class. /// </summary> /// <param name="transfer">The transfer which raised the event.</param> internal TransferEventArgs(Transfer transfer) { Transfer = transfer; }