diff --git a/Tools/Pipeline/Common/PipelineController.cs b/Tools/Pipeline/Common/PipelineController.cs index f52c493a7ac..f5fb9d6c508 100644 --- a/Tools/Pipeline/Common/PipelineController.cs +++ b/Tools/Pipeline/Common/PipelineController.cs @@ -399,7 +399,7 @@ public void Build(bool rebuild) BuildCommand(commands); } - private IEnumerable GetItems(IProjectItem dir) + public IEnumerable GetItems(IProjectItem dir) { foreach (var item in _project.ContentItems) if (item.OriginalPath.StartsWith(dir.OriginalPath + "/")) diff --git a/Tools/Pipeline/MainWindow.cs b/Tools/Pipeline/MainWindow.cs index c6a4a2f0068..5f451f471a7 100644 --- a/Tools/Pipeline/MainWindow.cs +++ b/Tools/Pipeline/MainWindow.cs @@ -210,7 +210,38 @@ public void EndTreeUpdate() public void UpdateProperties() { - propertyGridControl.SetObjects(PipelineController.Instance.SelectedItems); + // Convert selected DirectoryItems into ContentItems + + var stack = new List(); + var results = new List(); + + stack.AddRange(PipelineController.Instance.SelectedItems); + + while (stack.Count > 0) + { + var walk = stack[stack.Count - 1]; + stack.RemoveAt(stack.Count - 1); + + if (walk is ContentItem || walk is PipelineProject) + { + if (!results.Contains(walk)) + results.Add(walk); + + continue; + } + + if (walk is DirectoryItem) + { + var children = PipelineController.Instance.GetItems(walk); + foreach (var child in children) + { + if (!stack.Contains(child)) + stack.Add(child); + } + } + } + + propertyGridControl.SetObjects(results); } public void OutputAppend(string text)