AddSeparator() public method

public AddSeparator ( string path = "" ) : void
path string
return void
Example #1
0
        private void AddCommandsToMenu(GenericElementAdderMenu menu, IList <IElementAdderMenuCommand <TContext> > commands)
        {
            if (commands.Count == 0)
            {
                return;
            }

            if (!menu.IsEmpty)
            {
                menu.AddSeparator();
            }

            foreach (var command in commands)
            {
                if (_elementAdder != null && command.CanExecute(_elementAdder))
                {
                    menu.AddItem(command.Content, () => command.Execute(_elementAdder));
                }
                else
                {
                    menu.AddDisabledItem(command.Content);
                }
            }
        }