Пример #1
0
        private void GenerateButtons(ItemCollection items)
        {
            //每个Command都生成一个具体的按钮
            foreach (var command in this.CommandMetaGroup.Commands)
            {
                var group = new CommandMetaGroup(command.Name);
                group.AddCommand(command);

                var menuGenerator = new MenuItemGenerator
                {
                    CommandMetaGroup = group,
                    Context          = this.Context
                };
                var control = menuGenerator.CreateControl();
                items.Add(control);
            }
        }
Пример #2
0
        private void GenerateButtons(ItemCollection items)
        {
            //每个Command都生成一个具体的按钮
            foreach (var command in this.CommandMetaGroup.Commands)
            {
                var group = new CommandMetaGroup(command.Name);
                group.AddCommand(command);

                var menuGenerator = new MenuItemGenerator
                {
                    CommandMetaGroup = group,
                    Context = this.Context
                };
                var control = menuGenerator.CreateControl();
                items.Add(control);
            }
        }