|
@@ -98,22 +98,34 @@ namespace Quadarax.Application.Tools.Vsix.FilteredSolutionsExtension
|
|
|
{
|
|
{
|
|
|
BuildDependencyTree(treeItem, projectNode);
|
|
BuildDependencyTree(treeItem, projectNode);
|
|
|
totalDependencies += treeItem.Children.Count;
|
|
totalDependencies += treeItem.Children.Count;
|
|
|
|
|
+
|
|
|
|
|
+ // Extra logging for troubleshooting
|
|
|
|
|
+ ErrorHandler.LogInfo($"Project {projectNode.Name}: Expected deps={projectNode.Dependencies.Count}, Actual children={treeItem.Children.Count}, HasDependencies={treeItem.HasDependencies}");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ErrorHandler.LogInfo($"Total dependencies added to tree: {totalDependencies}");
|
|
ErrorHandler.LogInfo($"Total dependencies added to tree: {totalDependencies}");
|
|
|
|
|
|
|
|
- // Add a test child to first project if no dependencies exist (for debugging)
|
|
|
|
|
- if (totalDependencies == 0 && Projects.Count > 0)
|
|
|
|
|
|
|
+ // Add test dependencies to verify tree structure is working
|
|
|
|
|
+ if (totalDependencies == 0 && Projects.Count >= 2)
|
|
|
{
|
|
{
|
|
|
- var testChild = new ProjectTreeItem(new ProjectInfo { Name = "Test Dependency Project" })
|
|
|
|
|
|
|
+ // Add test dependency to demonstrate structure
|
|
|
|
|
+ var firstProject = Projects[0];
|
|
|
|
|
+ var secondProject = Projects.Count > 1 ? Projects[1] : null;
|
|
|
|
|
+
|
|
|
|
|
+ if (secondProject != null)
|
|
|
{
|
|
{
|
|
|
- IsDependency = true,
|
|
|
|
|
- IsSelectable = false
|
|
|
|
|
- };
|
|
|
|
|
- Projects[0].Children.Add(testChild);
|
|
|
|
|
- Projects[0].DependencyCountText = "(references 1 test project)";
|
|
|
|
|
- ErrorHandler.LogInfo("Added test dependency for debugging");
|
|
|
|
|
|
|
+ var testChild = new ProjectTreeItem(new ProjectInfo { Name = secondProject.ProjectInfo.Name })
|
|
|
|
|
+ {
|
|
|
|
|
+ IsDependency = true,
|
|
|
|
|
+ IsSelectable = false,
|
|
|
|
|
+ Tag = secondProject.Tag
|
|
|
|
|
+ };
|
|
|
|
|
+ firstProject.Children.Add(testChild);
|
|
|
|
|
+ firstProject.OnPropertyChanged(nameof(firstProject.HasDependencies));
|
|
|
|
|
+ firstProject.DependencyCountText = "(test - references 1 project)";
|
|
|
|
|
+ ErrorHandler.LogInfo($"Added test dependency: {firstProject.DisplayName} -> {secondProject.DisplayName}");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ProjectCountTextBlock.Text = $"{Projects.Count} projects found";
|
|
ProjectCountTextBlock.Text = $"{Projects.Count} projects found";
|
|
@@ -126,6 +138,9 @@ namespace Quadarax.Application.Tools.Vsix.FilteredSolutionsExtension
|
|
|
// Set the ItemsSource for the TreeView
|
|
// Set the ItemsSource for the TreeView
|
|
|
ProjectTreeView.ItemsSource = Projects;
|
|
ProjectTreeView.ItemsSource = Projects;
|
|
|
|
|
|
|
|
|
|
+ // Force a complete refresh of the TreeView
|
|
|
|
|
+ ProjectTreeView.UpdateLayout();
|
|
|
|
|
+
|
|
|
ErrorHandler.LogInfo($"Loaded {Projects.Count} projects in filter dialog with dependency trees");
|
|
ErrorHandler.LogInfo($"Loaded {Projects.Count} projects in filter dialog with dependency trees");
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -141,8 +156,6 @@ namespace Quadarax.Application.Tools.Vsix.FilteredSolutionsExtension
|
|
|
// Clear existing children first
|
|
// Clear existing children first
|
|
|
parentItem.Children.Clear();
|
|
parentItem.Children.Clear();
|
|
|
|
|
|
|
|
- ErrorHandler.LogInfo($"Building dependency tree for {projectNode.Name} with {projectNode.Dependencies.Count} dependencies");
|
|
|
|
|
-
|
|
|
|
|
// Add dependency children (projects that this project depends on)
|
|
// Add dependency children (projects that this project depends on)
|
|
|
foreach (var dependency in projectNode.Dependencies)
|
|
foreach (var dependency in projectNode.Dependencies)
|
|
|
{
|
|
{
|
|
@@ -163,24 +176,6 @@ namespace Quadarax.Application.Tools.Vsix.FilteredSolutionsExtension
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
parentItem.Children.Add(depItem);
|
|
parentItem.Children.Add(depItem);
|
|
|
- ErrorHandler.LogInfo($" Added dependency: {dependency.Name}");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Force property change notification after adding children
|
|
|
|
|
- parentItem.OnPropertyChanged(nameof(parentItem.HasDependencies));
|
|
|
|
|
-
|
|
|
|
|
- // Verify HasDependencies is working
|
|
|
|
|
- ErrorHandler.LogInfo($"Project {projectNode.Name}: HasDependencies = {parentItem.HasDependencies}, Children.Count = {parentItem.Children.Count}");
|
|
|
|
|
-
|
|
|
|
|
- // Update dependency count text for parent - only show if has dependencies
|
|
|
|
|
- if (projectNode.Dependencies.Count > 0)
|
|
|
|
|
- {
|
|
|
|
|
- parentItem.DependencyCountText = ""; // Remove count from main display
|
|
|
|
|
- ErrorHandler.LogInfo($"Project {projectNode.Name} has {projectNode.Dependencies.Count} dependencies");
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- parentItem.DependencyCountText = "";
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|