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