Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-edit content items using folder selection #18

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tools/Pipeline/Common/PipelineController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public void Build(bool rebuild)
BuildCommand(commands);
}

private IEnumerable<IProjectItem> GetItems(IProjectItem dir)
public IEnumerable<IProjectItem> GetItems(IProjectItem dir)
{
foreach (var item in _project.ContentItems)
if (item.OriginalPath.StartsWith(dir.OriginalPath + "/"))
Expand Down
33 changes: 32 additions & 1 deletion Tools/Pipeline/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,38 @@ public void EndTreeUpdate()

public void UpdateProperties()
{
propertyGridControl.SetObjects(PipelineController.Instance.SelectedItems);
// Convert selected DirectoryItems into ContentItems

var stack = new List<IProjectItem>();
var results = new List<IProjectItem>();

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)
Expand Down