暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

UpdateProgress.cs 1.5KB

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