@@ -35,6 +35,7 @@ public sealed class PullRequestDetailViewModel : PanePageViewModelBase, IPullReq
3535 readonly IPullRequestSessionManager sessionManager ;
3636 readonly IUsageTracker usageTracker ;
3737 readonly ITeamExplorerContext teamExplorerContext ;
38+ readonly IStatusBarNotificationService statusBarNotificationService ;
3839 IModelService modelService ;
3940 IPullRequestModel model ;
4041 string sourceBranchDisplayName ;
@@ -67,19 +68,22 @@ public PullRequestDetailViewModel(
6768 IPullRequestSessionManager sessionManager ,
6869 IModelServiceFactory modelServiceFactory ,
6970 IUsageTracker usageTracker ,
70- ITeamExplorerContext teamExplorerContext )
71+ ITeamExplorerContext teamExplorerContext ,
72+ IStatusBarNotificationService statusBarNotificationService )
7173 {
7274 Guard . ArgumentNotNull ( pullRequestsService , nameof ( pullRequestsService ) ) ;
7375 Guard . ArgumentNotNull ( sessionManager , nameof ( sessionManager ) ) ;
7476 Guard . ArgumentNotNull ( modelServiceFactory , nameof ( modelServiceFactory ) ) ;
7577 Guard . ArgumentNotNull ( usageTracker , nameof ( usageTracker ) ) ;
7678 Guard . ArgumentNotNull ( teamExplorerContext , nameof ( teamExplorerContext ) ) ;
79+ Guard . ArgumentNotNull ( statusBarNotificationService , nameof ( statusBarNotificationService ) ) ;
7780
7881 this . pullRequestsService = pullRequestsService ;
7982 this . sessionManager = sessionManager ;
8083 this . modelServiceFactory = modelServiceFactory ;
8184 this . usageTracker = usageTracker ;
8285 this . teamExplorerContext = teamExplorerContext ;
86+ this . statusBarNotificationService = statusBarNotificationService ;
8387
8488 Checkout = ReactiveCommand . CreateAsyncObservable (
8589 this . WhenAnyValue ( x => x . CheckoutState )
@@ -687,7 +691,7 @@ async Task DoSyncSubmodules(object unused)
687691 var complete = await pullRequestsService . SyncSubmodules ( LocalRepository , line =>
688692 {
689693 writer . WriteLine ( line ) ;
690- SetStatus ( line ) ;
694+ statusBarNotificationService . ShowMessage ( line ) ;
691695 } ) ;
692696 if ( ! complete )
693697 {
@@ -697,27 +701,7 @@ async Task DoSyncSubmodules(object unused)
697701 finally
698702 {
699703 IsBusy = false ;
700- SetStatus ( ) ;
701- }
702- }
703-
704- // HACK: This should probably be a `Status` property on `IPanePageViewModel`.
705- void SetStatus ( string line = null )
706- {
707- try
708- {
709- if ( line != null )
710- {
711- VisualStudio . Services . Dte . StatusBar . Text = line ;
712- }
713- else
714- {
715- VisualStudio . Services . Dte . StatusBar . Clear ( ) ;
716- }
717- }
718- catch ( Exception e )
719- {
720- log . Error ( e , "Error writing to StatusBar" ) ;
704+ statusBarNotificationService . ShowMessage ( string . Empty ) ;
721705 }
722706 }
723707
0 commit comments