Example #1
0
        /// <summary>
        /// Cancels the specified file-transfer.
        /// </summary>
        /// <param name="transfer">The file-transfer to cancel.</param>
        /// <exception cref="ArgumentNullException">The transfer parameter is
        /// null.</exception>
        /// <exception cref="ArgumentException">The specified transfer instance does
        /// not represent an active data-transfer operation.</exception>
        public void CancelFileTransfer(FileTransfer transfer)
        {
            transfer.ThrowIfNull("transfer");
            SISession session = GetSession(transfer.SessionId, transfer.From,
                                           transfer.To);

            if (session == null)
            {
                throw new ArgumentException("The specified transfer instance does not " +
                                            "represent an active data-transfer operation.");
            }
            session.Extension.CancelTransfer(session);
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the FileTransferProgressEventArgs class.
 /// </summary>
 /// <param name="transfer">A FileTransfer object representing the file-transfer
 /// operation for which the event is being raised.</param>
 /// <exception cref="ArgumentNullException">The transfer parameter is
 /// null.</exception>
 internal FileTransferProgressEventArgs(FileTransfer transfer)
 {
     transfer.ThrowIfNull("transfer");
     Transfer = transfer;
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the FileTransferAbortedEventArgs class.
 /// </summary>
 /// <param name="transfer">A FileTransfer object representing the file-transfer
 /// operation for which the event is being raised.</param>
 /// <exception cref="ArgumentNullException">The transfer parameter is
 /// null.</exception>
 internal FileTransferAbortedEventArgs(FileTransfer transfer)
 {
     transfer.ThrowIfNull("transfer");
     Transfer = transfer;
 }