Collapse solution explorer nodes
This commit is contained in:
Родитель
eece3b3439
Коммит
ceda2a2dea
|
@ -29,6 +29,10 @@ namespace Microsoft.Templates.Core.Gen
|
|||
|
||||
public virtual void RestorePackages()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void CollapseSolutionItems()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace Microsoft.Templates.Wizard.VisualStudio
|
|||
GenContext.ToolBox.Shell.ShowStatusBarMessage(StringRes.RestoringMessage);
|
||||
GenContext.ToolBox.Shell.RestorePackages();
|
||||
|
||||
GenContext.ToolBox.Shell.ShowTaskList();
|
||||
GenContext.ToolBox.Shell.CollapseSolutionItems();
|
||||
}
|
||||
|
||||
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace Microsoft.Templates.Wizard.VisualStudio
|
|||
return;
|
||||
}
|
||||
var proj = GetActiveProject();
|
||||
|
||||
foreach (var item in itemsFullPath)
|
||||
{
|
||||
proj.ProjectItems.AddFromFile(item);
|
||||
|
@ -230,5 +231,26 @@ namespace Microsoft.Templates.Wizard.VisualStudio
|
|||
installedPackages.ForEach(p => uninstaller.UninstallPackage(activeProject, p.Id, false));
|
||||
installedPackages.ForEach(p => installer.InstallPackage("All", activeProject, p.Id, p.VersionString, true));
|
||||
}
|
||||
|
||||
public override void CollapseSolutionItems()
|
||||
{
|
||||
var solutionExplorer = Dte.Windows.Item(EnvDTE.Constants.vsext_wk_SProjectWindow).Object as UIHierarchy;
|
||||
var projectNode = solutionExplorer.UIHierarchyItems.Item(1)?.UIHierarchyItems.Item(1);
|
||||
|
||||
foreach (UIHierarchyItem item in projectNode.UIHierarchyItems)
|
||||
{
|
||||
Collapse(item);
|
||||
}
|
||||
}
|
||||
|
||||
private void Collapse(UIHierarchyItem item)
|
||||
{
|
||||
foreach (UIHierarchyItem subitem in item.UIHierarchyItems)
|
||||
{
|
||||
Collapse(subitem);
|
||||
}
|
||||
|
||||
item.UIHierarchyItems.Expanded = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче