CA-123572: Fixed regression: restored "New folder" item in the context menu of the Folders root node.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2013-12-31 15:47:52 +00:00
parent 7f29ebf2e9
commit f120ffd496
2 changed files with 11 additions and 1 deletions

View File

@ -144,7 +144,9 @@ namespace XenAdmin.Commands
protected override bool CanExecuteCore(SelectedItemCollection selection)
{
return selection.ContainsOneItemOfType<Folder>() && ConnectionAvailable();
return (selection.ContainsOneItemOfType<Folder>()
|| selection.ContainsOneItemOfType<GroupingTag>(t => t.Grouping is OrganizationViewFolders))
&& ConnectionAvailable();
}
private bool ConnectionAvailable()

View File

@ -488,6 +488,14 @@ namespace XenAdmin.Controls.MainWindowControls
TreeContextMenu.Items.Add(new CommandToolStripMenuItem(new ConnectAllHostsCommand(Program.MainWindow.CommandInterface), true));
TreeContextMenu.Items.Add(new CommandToolStripMenuItem(new DisconnectAllHostsCommand(Program.MainWindow.CommandInterface), true));
}
else
{
var groupingTag = e.Node.Tag as GroupingTag;
if (groupingTag != null && groupingTag.Grouping as OrganizationViewFolders != null)
TreeContextMenu.Items.Add(new CommandToolStripMenuItem(
new NewFolderCommand(Program.MainWindow.CommandInterface, new[] { new SelectedItem(groupingTag, e.Node) }),
true));
}
}
else
{