private void SetupMenu() { var mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; var shell = GetService(typeof(SVsUIShell)) as IVsUIShell; if (mcs != null) { newFolderMenu = new FolderMenuCommands(DTE.Value, mcs, shell); newFolderMenu.SetupCommands(); } }
protected override void Initialize() { base.Initialize(); VSUtils.ForegroundThreadGuard.BindThread(); var componentModel = (IComponentModel)GetService(typeof(SComponentModel)); classificationColorManager = componentModel.DefaultExportProvider.GetExportedValue<ClassificationColorManager>(); shellService = GetService(typeof(SVsShell)) as IVsShell; if (shellService != null) ErrorHandler.ThrowOnFailure(shellService.AdviseBroadcastMessages(this, out broadcastEventCookie)); IServiceContainer serviceContainer = this; serviceContainer.AddService(typeof(GeneralOptionsPage), delegate { return GetDialogPage(typeof(GeneralOptionsPage)); }, promote:true); serviceContainer.AddService(typeof(FantomasOptionsPage), delegate { return GetDialogPage(typeof(FantomasOptionsPage)); }, promote:true); OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; var shell = GetService(typeof(SVsUIShell)) as IVsUIShell; var logger = new Logger(ServiceProvider.GlobalProvider); if (mcs != null) { var newFolderMenu = new FolderMenuCommands(DTE.Value, mcs, shell); newFolderMenu.SetupCommands(); } }