Skip to content

Commit b57986b

Browse files
authored
Merge pull request #1809 from Hosch250/Issue1808
Ensure components are in project under source control before handling sink events
2 parents b72ec45 + b295c59 commit b57986b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ public void HandleAddedComponent(VBComponent component)
108108
{
109109
if (Provider == null || !Provider.HandleVbeSinkEvents) { return; }
110110

111+
if (component.Collection.Parent.HelpFile != Provider.CurrentRepository.Id)
112+
{
113+
return;
114+
}
115+
111116
var fileStatus = Provider.Status().SingleOrDefault(stat => stat.FilePath.Split('.')[0] == component.Name);
112117
if (fileStatus != null)
113118
{
@@ -119,6 +124,11 @@ public void HandleRemovedComponent(VBComponent component)
119124
{
120125
if (Provider == null || !Provider.HandleVbeSinkEvents) { return; }
121126

127+
if (component.Collection.Parent.HelpFile != Provider.CurrentRepository.Id)
128+
{
129+
return;
130+
}
131+
122132
var fileStatus = Provider.Status().SingleOrDefault(stat => stat.FilePath.Split('.')[0] == component.Name);
123133
if (fileStatus != null)
124134
{
@@ -130,6 +140,11 @@ public void HandleRenamedComponent(VBComponent component, string oldName)
130140
{
131141
if (Provider == null || !Provider.HandleVbeSinkEvents) { return; }
132142

143+
if (component.Collection.Parent.HelpFile != Provider.CurrentRepository.Id)
144+
{
145+
return;
146+
}
147+
133148
var fileStatus = Provider.LastKnownStatus().SingleOrDefault(stat => stat.FilePath.Split('.')[0] == oldName);
134149
if (fileStatus != null)
135150
{

0 commit comments

Comments
 (0)