Exemple #1
0
 private void BuildMenuCommandHierarchy(ICommandEx parentCommand, ICommandSourceParent commandVisual, ShellMenu shellMenu)
 {
     if (parentCommand != null)
     {
         ICommandSourceParent parentCommandVisual;
         if (_commandInformations.TryGetValue(parentCommand, out parentCommandVisual))
         {
             parentCommandVisual.AddItem(commandVisual);
             return;
         }
         parentCommandVisual = new ShellMenuItem(parentCommand);
         parentCommandVisual.AddItem(commandVisual);
         _commandInformations.Add(parentCommand, parentCommandVisual);
         parentCommand = parentCommand.MenuCommandParent;
         BuildMenuCommandHierarchy(parentCommand, parentCommandVisual, shellMenu);
     }
     else
     {
         shellMenu.AddItem(commandVisual);
     }
 }
Exemple #2
0
 private void BuildMenuCommandHierarchy(ICommandEx parentCommand, ICommandSourceParent commandVisual, ShellMenu shellMenu)
 {
     if (parentCommand != null)
     {
         ICommandSourceParent parentCommandVisual;
         if (_commandInformations.TryGetValue(parentCommand, out parentCommandVisual))
         {
             parentCommandVisual.AddItem(commandVisual);
             return;
         }
         parentCommandVisual = new ShellMenuItem(parentCommand);
         parentCommandVisual.AddItem(commandVisual);
         _commandInformations.Add(parentCommand, parentCommandVisual);
         parentCommand = parentCommand.MenuCommandParent;
         BuildMenuCommandHierarchy(parentCommand, parentCommandVisual, shellMenu);
     }
     else
     {
         shellMenu.AddItem(commandVisual);
     }
 }