No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProgressOperationHandler.cs 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using GluonGui.WorkspaceWindow.Views.Checkin.Operations;
  2. using GluonGui.WorkspaceWindow.Views.WorkspaceExplorer.Explorer;
  3. namespace Unity.PlasticSCM.Editor.Gluon
  4. {
  5. internal class ProgressOperationHandler : IUpdateProgress, ICheckinProgress
  6. {
  7. internal ProgressOperationHandler(WorkspaceWindow workspaceWindow)
  8. {
  9. mWorkspaceWindow = workspaceWindow;
  10. }
  11. internal bool IsOperationInProgress()
  12. {
  13. return mUpdateProgress != null
  14. || mCheckinProgress != null;
  15. }
  16. internal void CancelUpdateProgress()
  17. {
  18. mUpdateProgress.Cancel();
  19. }
  20. void ICheckinProgress.ShowProgress()
  21. {
  22. mCheckinProgress = new CheckinProgress(mWorkspaceWindow);
  23. }
  24. void ICheckinProgress.RefreshProgress(CheckinProgressData progress)
  25. {
  26. mCheckinProgress.Refresh(progress);
  27. }
  28. void ICheckinProgress.EndProgress()
  29. {
  30. mCheckinProgress = null;
  31. mWorkspaceWindow.Progress.ResetProgress();
  32. mWorkspaceWindow.RequestRepaint();
  33. }
  34. void IUpdateProgress.ShowNoCancelableProgress()
  35. {
  36. mUpdateProgress = new UpdateProgress(mWorkspaceWindow);
  37. mUpdateProgress.SetCancellable(false);
  38. }
  39. void IUpdateProgress.ShowCancelableProgress()
  40. {
  41. mUpdateProgress = new UpdateProgress(mWorkspaceWindow);
  42. mUpdateProgress.SetCancellable(true);
  43. }
  44. void IUpdateProgress.RefreshProgress(
  45. Codice.Client.BaseCommands.UpdateProgress updateProgress,
  46. UpdateProgressData updateProgressData)
  47. {
  48. mUpdateProgress.RefreshProgress(updateProgress, updateProgressData);
  49. }
  50. void IUpdateProgress.EndProgress()
  51. {
  52. mUpdateProgress = null;
  53. mWorkspaceWindow.Progress.ResetProgress();
  54. mWorkspaceWindow.RequestRepaint();
  55. }
  56. UpdateProgress mUpdateProgress;
  57. CheckinProgress mCheckinProgress;
  58. WorkspaceWindow mWorkspaceWindow;
  59. }
  60. }