Example #1
0
 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
     });
 }
Example #2
0
 /// <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;
 }
Example #3
0
 /// <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;
 }
Example #4
0
 /// <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;
 }