/// <summary> /// Initializes a new instance of the <see cref="DataAnnoRemoveAttrCommand" /> class. Adds our command /// handlers for menu (commands must exist in the command table file) /// </summary> /// <param name="package"> Owner package, not null. </param> /// <param name="commandService"> Command service to add command to, not null. </param> private DataAnnoRemoveAttrCommand(AsyncPackage package, OleMenuCommandService commandService, SDTE SDTEService, IDataAnnoAttributeService attributeService, TextSelectionExecutor textSelectionExecutor) { this._package = package ?? throw new ArgumentNullException(nameof(package)); _attributeService = attributeService; _textSelectionExecutor = textSelectionExecutor; _sdteService = SDTEService; commandService = commandService ?? throw new ArgumentNullException(nameof(commandService)); var menuCommandID = new CommandID(_commandSet, CommandId); var menuItem = new MenuCommand(Execute, menuCommandID); commandService.AddCommand(menuItem); }
/// <summary> /// Initializes a new instance of the <see cref="DataAnnoAddAttrCommand" /> class. Adds our command handlers /// for menu (commands must exist in the command table file) /// </summary> /// <param name="package"> Owner package, not null. </param> /// <param name="commandService"> Command service to add command to, not null. </param> private DataAnnoAddAttrCommand(AsyncPackage package, OleMenuCommandService commandService, SDTE SDTEService, IDataAnnoAttributeService attributeService, TextSelectionExecutor textSelectionExecutor, IVsThreadedWaitDialogFactory dialogFactory, SelectedItemCountExecutor selectedItemCountExecutor, AttributeExecutor attributeExecutor) { _package = package ?? throw new ArgumentNullException(nameof(package)); commandService = commandService ?? throw new ArgumentNullException(nameof(commandService)); _sdteService = SDTEService; _attributeService = attributeService; _textSelectionExecutor = textSelectionExecutor; _dialogFactory = dialogFactory; _selectedItemCountExecutor = selectedItemCountExecutor; _attributeExecutor = attributeExecutor; var menuCommandID = new CommandID(_commandSet, CommandId); var menuItem = new MenuCommand(Execute, menuCommandID); commandService.AddCommand(menuItem); }