public void RegisterTo(OleMenuCommandService menuCommandService, SpecFlowCmdSet commandId) { CommandID menuCommandID = new CommandID(GuidList.guidSpecFlowCmdSet, (int)(uint)commandId); OleMenuCommand menuItem = new OleMenuCommand(InvokeHandler, menuCommandID); menuItem.BeforeQueryStatus += BeforeQueryStatusHandler; menuCommandService.AddCommand(menuItem); }