private ExpertWatchCommand(ExpertWatchPackage package, OleMenuCommandService commandService) { this.package = package ?? throw new ArgumentNullException(nameof(package)); commandService = commandService ?? throw new ArgumentNullException(nameof(commandService)); var menuCommandID = new CommandID(CommandSet, CommandId); menuCommand = new MenuCommand(this.ShowToolWindow, menuCommandID); commandService.AddCommand(menuCommand); }
public static void Initialize(ExpertWatchPackage package) { OleMenuCommandService commandService = package.GetService(typeof(IMenuCommandService)) as OleMenuCommandService; Instance = new ExpertWatchCommand(package, commandService); }