示例#1
0
        public void AddCommand(ICommand command, AbstractMenuAttribute attribute)
        {
            var model = new CommandMenuModel(command, attribute.AfterMenuItem, attribute.SeperatorAbove,
                                             attribute.SeperatorBelow, attribute.Image);

            CollectionMenuModel parent = _root;

            if (!string.IsNullOrEmpty(attribute.Path))
            {
                parent = FindOrCreateCollection(attribute.Path);
            }

            parent.AddModel(model);
        }
        public void AddCommand(ICommand command, AbstractMenuAttribute attribute)
        {
            var model = new CommandMenuModel(command, attribute.AfterMenuItem, attribute.SeperatorAbove,
                                             attribute.SeperatorBelow, attribute.Image);

            CollectionMenuModel parent = _root;

            if (!string.IsNullOrEmpty(attribute.Path))
            {
                parent = FindOrCreateCollection(attribute.Path);
            }

            parent.AddModel(model);
        }