Пример #1
0
        public MenuCommandServiceImpl(IServiceProvider serviceProvider)
            : base(serviceProvider)
        {
            this.serviceProvider = serviceProvider;
            menuCommandService   = new System.ComponentModel.Design.MenuCommandService(serviceProvider);

            MenuCommand undoCommand = new MenuCommand(new EventHandler(ExecuteUndo), StandardCommands.Undo);

            menuCommandService.AddCommand(undoCommand);

            MenuCommand redoCommand = new MenuCommand(new EventHandler(ExecuteRedo), StandardCommands.Redo);

            menuCommandService.AddCommand(redoCommand);

            MenuCommand ViewCodeCommand = new MenuCommand(new EventHandler(OnExecuteViewCode2), StandardCommands.ViewCode);

            menuCommandService.AddCommand(ViewCodeCommand);

            MenuCommand PropertyCommand = new MenuCommand(new EventHandler(OnExecuteViewProperty2), StandardCommands.Properties);

            menuCommandService.AddCommand(PropertyCommand);

            MenuCommand CreateEventCommand = new MenuCommand(new EventHandler(OnExecuteCreateEvent2), StandardCommands.DocumentOutline);

            menuCommandService.AddCommand(CreateEventCommand);
        }
Пример #2
0
 public static void Register(DTE2 dte, MenuCommandService mcs)
 {
     _dte = dte;
     CommandID nestAllId = new CommandID(GuidList.guidFileNestingCmdSet, (int)PkgCmdIDList.cmdRunNesting);
     OleMenuCommand menuNestAll = new OleMenuCommand(NestAll, nestAllId);
     mcs.AddCommand(menuNestAll);
 }
Пример #3
0
 public static void Register(MenuCommandService mcs)
 {
     CommandID nestId = new CommandID(GuidList.guidFileNestingCmdSet, (int)PkgCmdIDList.cmdNest);
     OleMenuCommand menuNest = new OleMenuCommand(Nest, nestId);
     mcs.AddCommand(menuNest);
     menuNest.BeforeQueryStatus += BeforeNest;
 }
Пример #4
0
 public static void Register(MenuCommandService mcs)
 {
     var cmdId = new CommandID(VSCommandTable.PackageGuids.VSPackageCmdSetGuid, VSCommandTable.CommandIds.CreateServiceCode);
     var menu = new OleMenuCommand(MenuItemCallbackHandler, cmdId);
     menu.BeforeQueryStatus += BeforeQueryStatus;
     mcs.AddCommand(menu);
 }
Пример #5
0
 public static void Register(MenuCommandService mcs)
 {
     var cmdId = new CommandID(VSCommandTable.PackageGuids.VSPackageCmdSetGuid, VSCommandTable.CommandIds.SolutionExplorerItemContextMenuItem);
     var menu = new OleMenuCommand((s, e) => { }, cmdId);
     menu.BeforeQueryStatus += BeforeQueryStatus;
     mcs.AddCommand(menu);
 }
Пример #6
0
 public static void Register(DTE2 dte, MenuCommandService mcs)
 {
     _dte = dte;
     CommandID autoId = new CommandID(GuidList.guidFileNestingCmdSet, (int)PkgCmdIDList.cmdAutoNesting);
     OleMenuCommand menuAuto = new OleMenuCommand(AutoNest, autoId);
     mcs.AddCommand(menuAuto);
     menuAuto.BeforeQueryStatus += BeforeAutoNest;
 }
Пример #7
0
 // Ajout de command satndard au service
 public override void AddCommand(System.ComponentModel.Design.MenuCommand command)
 {
     try
     {
         menuCommandService.AddCommand(command);
     }
     catch
     {
     }
 }