Ejemplo n.º 1
0
 protected MenuItem(Command command, Generator generator, Type type, bool initialize = true)
     : base(generator, type, initialize)
 {
     ID        = command.ID;
     Text      = command.MenuText;
     ToolTip   = command.ToolTip;
     Shortcut  = command.Shortcut;
     Click    += (sender, e) => command.OnExecuted(e);
     Validate += (sender, e) => Enabled = command.Enabled;
     Enabled   = command.Enabled;
     command.EnabledChanged += (sender, e) => Enabled = command.Enabled;
     if (initialize)
     {
         Handler.CreateFromCommand(command);
     }
 }