Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit b504efc

Browse files
fix bug in SolutionFolder logic: projects inside solution folders were added twice in some cases
1 parent 5003477 commit b504efc

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/Main/SharpDevelop/Project/SolutionFolder.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,14 @@ protected override void OnRemove(ISolutionItem item)
8282

8383
protected override void OnCollectionChanged(IReadOnlyCollection<ISolutionItem> removedItems, IReadOnlyCollection<ISolutionItem> addedItems)
8484
{
85-
using (folder.parentSolution.ReportBatch()) {
86-
foreach (ISolutionItem item in removedItems) {
87-
folder.parentSolution.ReportRemovedItem(item);
88-
}
89-
foreach (ISolutionItem item in addedItems) {
90-
folder.parentSolution.ReportAddedItem(item);
85+
if (folder.parentSolution.IsAncestorOf(folder)) {
86+
using (folder.parentSolution.ReportBatch()) {
87+
foreach (ISolutionItem item in removedItems) {
88+
folder.parentSolution.ReportRemovedItem(item);
89+
}
90+
foreach (ISolutionItem item in addedItems) {
91+
folder.parentSolution.ReportAddedItem(item);
92+
}
9193
}
9294
}
9395
base.OnCollectionChanged(removedItems, addedItems);

0 commit comments

Comments
 (0)