public TransferForm(IResourceTransfer transferObject)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.transferObject = transferObject;
        }
        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 ResultImportResource2SinkEx(System.Uri importFromThis, IUPnPMedia owner, IMediaResource importToThis, IResourceTransfer transferObject, object Tag, UPnPInvokeException error)
 {
     new TransferForm(transferObject).Show();
 }
 private void ResultImportResource2Sink(System.Uri importFromThis, IUPnPMedia owner, IMediaResource importToThis, IResourceTransfer transferObject, object Tag, UPnPInvokeException error)
 {
     //MessageBox.Show(this,"Transfering...","Object Import",MessageBoxButtons.OK,MessageBoxIcon.Information);
     object[] args = new object[6];
     args[0] = importFromThis;
     args[1] = owner;
     args[2] = importToThis;
     args[3] = transferObject;
     args[4] = Tag;
     args[5] = error;
     this.BeginInvoke(new OpenSource.UPnP.AV.MediaServer.CP.CpMediaDelegates.Delegate_ResultImportResource2(ResultImportResource2SinkEx),args);
 }