File size: 1,559 Bytes
18a519f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | using System;
using Codice.Client.BaseCommands;
using Codice.Client.Commands;
using PlasticGui.WorkspaceWindow;
using PlasticGui.WorkspaceWindow.Update;
namespace Unity.PlasticSCM.Editor.Developer
{
internal class UpdateProgress
{
internal UpdateProgress(
UpdateNotifier notifier, string wkPath, string title,
WorkspaceWindow workspaceWindow)
{
mNotifier = notifier;
mWkPath = wkPath;
mWorkspaceWindow = workspaceWindow;
mProgressData = new BuildProgressSpeedAndRemainingTime.ProgressData(DateTime.Now);
mWorkspaceWindow.Progress.ProgressHeader = title;
mWorkspaceWindow.Progress.CanCancelProgress = false;
}
internal void OnUpdateProgress()
{
var progress = mWorkspaceWindow.Progress;
progress.ProgressHeader = UpdateProgressRender.FixNotificationPath(
mWkPath, mNotifier.GetNotificationMessage());
UpdateOperationStatus status = mNotifier.GetUpdateStatus();
progress.TotalProgressMessage = UpdateProgressRender.GetProgressString(
status, mProgressData);
progress.TotalProgressPercent = GetProgressBarPercent.ForTransfer(
status.UpdatedSize, status.TotalSize) / 100f;
}
readonly BuildProgressSpeedAndRemainingTime.ProgressData mProgressData;
readonly WorkspaceWindow mWorkspaceWindow;
readonly string mWkPath;
readonly UpdateNotifier mNotifier;
}
}
|