Ejemplo n.º 1
0
        public void UpdateInfos(KfsFileTransfer xfer)
        {
            // Update persistant data

            OrderID = xfer.OrderID;
            Direction = xfer is KfsFileUpload;
            Status = xfer.Status;
            File = xfer.LastFullPath;
            BytesTransfered = xfer.BytesTransferred;

            if (xfer is KfsFileUpload)
            {
                BytesToTransfer = ((KfsFileUpload)xfer).Size;
            }
            else
            {
                BytesToTransfer = ((KfsFileDownload)xfer).Version.Size;
            }

            Error = xfer.Error;

            // Update subitems
            this.Name = OrderID.ToString();
            this.Text = this.Name;

            if (InError)
            {
                this.SubItems[ColumnKey.Status.ToString()].Text = "Failed";
                this.SubItems[ColumnKey.Progress.ToString()].Text = Error.Reason;
                this.ForeColor = Color.Red;
            }
            else
            {
                this.SubItems[ColumnKey.Status.ToString()].Text = Base.GetEnumDescription(Status);
                this.SubItems[ColumnKey.Progress.ToString()].Text = Base.GetHumanFileSize(BytesTransfered) + "/" + Base.GetHumanFileSize(BytesToTransfer);
                this.ForeColor = Color.Black;
            }
            this.SubItems[ColumnKey.Direction.ToString()].Text = Direction ? "U" : "D";
            this.SubItems[ColumnKey.File.ToString()].Text = File;
        }
Ejemplo n.º 2
0
Archivo: KfsShare.cs Proyecto: tmbx/kwm
 /// <summary>
 /// Called when a transfer error has occurred.
 /// </summary>
 public void OnTransferError(KfsTransferError error)
 {
     TransferErrorArray.Add(error);
     RequestStatusViewUpdate("OnTransferError");
 }