Microsoft.Phone.Controls.TransferMonitor.TransferringStatusText C# (CSharp) Method

TransferringStatusText() private method

private TransferringStatusText ( ) : string
return string
        protected string TransferringStatusText()
        {
            IsProgressIndeterminate = TransferType == TransferType.Upload ? (_request.TotalBytesToSend <= 0) : (_request.TotalBytesToReceive <= 0);

            long total = TransferType == TransferType.Upload ? _request.TotalBytesToSend : _request.TotalBytesToReceive;
            long progress = TransferType == TransferType.Upload ? _request.BytesSent : _request.BytesReceived;

            if (progress <= 0)
                return ControlResources.StatusPending;

            string direction = TransferType == TransferType.Upload ? ControlResources.StatusUploading : ControlResources.StatusDownloading;
            string fraction;

            if (IsProgressIndeterminate)
                fraction = progress <= 0 ? "" : BytesToString(progress);
            else
                fraction = string.Format(ControlResources.PartOfWhole, BytesToString(progress),
                                         BytesToString(total));
            TotalBytesToTransfer = total;
            BytesTransferred = progress;

            return string.Format("{0} {1}", direction, fraction);
        }