private void ResultGetTransferProgressSink(IResourceTransfer transferObject, CpContentDirectory.Enum_A_ARG_TYPE_TransferStatus transferStatus, System.Int64 transferLength, System.Int64 transferTotal, object Tag, UPnPInvokeException error, Exception castError)
        {
            label1.Text = (antiblockcount++).ToString();

            if (transferLength < 0)
            {
                transferProgressLabel.Text  = transferTotal + " bytes send";
                transferProgressBar.Value   = 0;
                transferProgressBar.Maximum = 100;
            }
            else
            {
                transferProgressBar.Value   = (int)transferTotal;
                transferProgressBar.Maximum = (int)transferLength;
                transferProgressLabel.Text  = (((double)transferLength / (double)transferTotal) * 100).ToString() + "%";
            }
            stateTextBox.Text = transferStatus.ToString();

            if (transferStatus == CpContentDirectory.Enum_A_ARG_TYPE_TransferStatus.IN_PROGRESS)
            {
                transferObject.RequestGetTransferProgress(null, new CpMediaDelegates.Delegate_ResultGetTransferProgress(ResultGetTransferProgressSink));
            }
        }
 private void TransferForm_Load(object sender, System.EventArgs e)
 {
     transferObject.RequestGetTransferProgress(null, new CpMediaDelegates.Delegate_ResultGetTransferProgress(ResultGetTransferProgressSink));
 }