File size: 1,195 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
using GluonGui.WorkspaceWindow.Views.WorkspaceExplorer.Explorer;

namespace Unity.PlasticSCM.Editor.Gluon
{
    internal class UpdateProgress
    {
        internal UpdateProgress(WorkspaceWindow workspaceWindow)
        {
            mWorkspaceWindow = workspaceWindow;
        }

        internal void Cancel()
        {
            if (mUpdateProgress == null)
                return;

            mUpdateProgress.Cancel();
        }

        internal void SetCancellable(bool bCancelable)
        {
            mWorkspaceWindow.Progress.CanCancelProgress = bCancelable;
        }

        internal void RefreshProgress(
            Codice.Client.BaseCommands.UpdateProgress progress,
            UpdateProgressData updateProgressData)
        {
            mUpdateProgress = progress;

            mWorkspaceWindow.Progress.ProgressHeader = updateProgressData.Details;

            mWorkspaceWindow.Progress.TotalProgressMessage = updateProgressData.Status;
            mWorkspaceWindow.Progress.TotalProgressPercent = updateProgressData.ProgressValue / 100;
        }

        Codice.Client.BaseCommands.UpdateProgress mUpdateProgress;

        WorkspaceWindow mWorkspaceWindow;
    }
}