Skip to content

Commit 45b4183

Browse files
committed
Disable sinks for each loaded component.
1 parent f916e83 commit 45b4183

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

RetailCoder.VBE/App.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public App(VBE vbe, IMessageBox messageBox,
7474
_panelVM.OpenRepoStarted += DisableSinkEventHandlers;
7575
_panelVM.OpenRepoCompleted += EnableSinkEventHandlersAndUpdateCache;
7676

77-
_branchesVM.MergeStarted += DisableSinkEventHandlers;
78-
_branchesVM.MergeCompleted += EnableSinkEventHandlersAndUpdateCache;
77+
_branchesVM.LoadingComponentsStarted += DisableSinkEventHandlers;
78+
_branchesVM.LoadingComponentsCompleted += EnableSinkEventHandlersAndUpdateCache;
7979

8080
_hooks.MessageReceived += _hooks_MessageReceived;
8181
_configService.SettingsChanged += _configService_SettingsChanged;
@@ -458,8 +458,8 @@ public void Dispose()
458458

459459
if (_branchesVM != null)
460460
{
461-
_branchesVM.MergeStarted -= DisableSinkEventHandlers;
462-
_branchesVM.MergeCompleted -= EnableSinkEventHandlersAndUpdateCache;
461+
_branchesVM.LoadingComponentsStarted -= DisableSinkEventHandlers;
462+
_branchesVM.LoadingComponentsCompleted -= EnableSinkEventHandlersAndUpdateCache;
463463
}
464464

465465
if (_hooks != null)

RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,14 @@ public string CurrentBranch
107107

108108
try
109109
{
110+
OnLoadingComponentsStarted();
110111
Provider.Checkout(_currentBranch);
111112
}
112113
catch (SourceControlException ex)
113114
{
114115
RaiseErrorEvent(ex.Message, ex.InnerException.Message, NotificationType.Error);
115116
}
117+
OnLoadingComponentsCompleted();
116118
}
117119
}
118120
}
@@ -279,7 +281,7 @@ private void CreateBranchCancel()
279281

280282
private void MergeBranchOk()
281283
{
282-
OnMergeStarted();
284+
OnLoadingComponentsStarted();
283285

284286
try
285287
{
@@ -288,13 +290,13 @@ private void MergeBranchOk()
288290
catch (SourceControlException ex)
289291
{
290292
RaiseErrorEvent(ex.Message, ex.InnerException.Message, NotificationType.Error);
291-
OnMergeCompleted();
293+
OnLoadingComponentsCompleted();
292294
return;
293295
}
294296

295297
DisplayMergeBranchesGrid = false;
296298
RaiseErrorEvent(RubberduckUI.SourceControl_MergeStatus, string.Format(RubberduckUI.SourceControl_SuccessfulMerge, SourceBranch, DestinationBranch), NotificationType.Info);
297-
OnMergeCompleted();
299+
OnLoadingComponentsCompleted();
298300
}
299301

300302
private void MergeBranchCancel()
@@ -429,20 +431,20 @@ private void RaiseErrorEvent(string message, string innerMessage, NotificationTy
429431
}
430432
}
431433

432-
public event EventHandler<EventArgs> MergeStarted;
433-
private void OnMergeStarted()
434+
public event EventHandler<EventArgs> LoadingComponentsStarted;
435+
private void OnLoadingComponentsStarted()
434436
{
435-
var handler = MergeStarted;
437+
var handler = LoadingComponentsStarted;
436438
if (handler != null)
437439
{
438440
handler(this, EventArgs.Empty);
439441
}
440442
}
441443

442-
public event EventHandler<EventArgs> MergeCompleted;
443-
private void OnMergeCompleted()
444+
public event EventHandler<EventArgs> LoadingComponentsCompleted;
445+
private void OnLoadingComponentsCompleted()
444446
{
445-
var handler = MergeCompleted;
447+
var handler = LoadingComponentsCompleted;
446448
if (handler != null)
447449
{
448450
handler(this, EventArgs.Empty);

0 commit comments

Comments
 (0)