Skip to content
This repository was archived by the owner on Aug 9, 2025. It is now read-only.

Commit 9efa905

Browse files
committed
"Check selected items" -> "Check selected projects"
1 parent 2d945e1 commit 9efa905

File tree

2 files changed

+45
-41
lines changed

2 files changed

+45
-41
lines changed

CPPCheckPlugin/CPPCheckPlugin.vsct

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
<Parent guid="guidCPPCheckPluginCmdSet" id="MyMenuGroup" />
9696
<Icon guid="guidImages" id="bmpPic1" />
9797
<Strings>
98-
<ButtonText>Check selected items</ButtonText>
98+
<ButtonText>Check selected projects</ButtonText>
9999
</Strings>
100100
</Button>
101101

@@ -136,7 +136,7 @@
136136
<Parent guid="guidCPPCheckPluginMultiItemCmdSet" id="MyMultiItemMenuGroup" />
137137
<Icon guid="guidImages" id="bmpPic1" />
138138
<Strings>
139-
<ButtonText>CPPCheck selected items</ButtonText>
139+
<ButtonText>CPPCheck selected projects</ButtonText>
140140
</Strings>
141141
</Button>
142142

CPPCheckPlugin/CPPCheckPluginPackage.cs

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -164,54 +164,58 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
164164

165165
// Add our command handlers for menu (commands must exist in the .vsct file)
166166
OleMenuCommandService mcs = await GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;
167-
if (null != mcs)
167+
if (mcs == null)
168168
{
169-
// Create the command for the menu item.
170-
{
171-
CommandID menuCommandID = new CommandID(GuidList.guidCPPCheckPluginCmdSet, (int)PkgCmdIDList.cmdidCheckProjectCppcheck);
172-
menuCheckCurrentProject = new MenuCommand(onCheckCurrentProjectRequested, menuCommandID);
173-
mcs.AddCommand(menuCheckCurrentProject);
174-
}
169+
Debug.Assert(mcs != null);
170+
return;
171+
}
175172

176-
{
177-
// Create the command for the settings window
178-
CommandID settingsWndCmdId = new CommandID(GuidList.guidCPPCheckPluginCmdSet, (int)PkgCmdIDList.cmdidSettings);
179-
menuShowSettingsWindow = new MenuCommand(onSettingsWindowRequested, settingsWndCmdId);
180-
mcs.AddCommand(menuShowSettingsWindow);
181-
}
173+
174+
// Create the command for the menu item.
175+
{
176+
CommandID menuCommandID = new CommandID(GuidList.guidCPPCheckPluginCmdSet, (int)PkgCmdIDList.cmdidCheckProjectCppcheck);
177+
menuCheckCurrentProject = new MenuCommand(onCheckCurrentProjectRequested, menuCommandID);
178+
mcs.AddCommand(menuCheckCurrentProject);
179+
}
182180

183-
{
184-
CommandID stopCheckMenuCommandID = new CommandID(GuidList.guidCPPCheckPluginCmdSet, (int)PkgCmdIDList.cmdidStopCppcheck);
185-
menuCancelCheck = new MenuCommand(onStopCheckRequested, stopCheckMenuCommandID);
186-
mcs.AddCommand(menuCancelCheck);
187-
}
181+
{
182+
// Create the command for the settings window
183+
CommandID settingsWndCmdId = new CommandID(GuidList.guidCPPCheckPluginCmdSet, (int)PkgCmdIDList.cmdidSettings);
184+
menuShowSettingsWindow = new MenuCommand(onSettingsWindowRequested, settingsWndCmdId);
185+
mcs.AddCommand(menuShowSettingsWindow);
186+
}
188187

189-
{
190-
CommandID selectionsMenuCommandID = new CommandID(GuidList.guidCPPCheckPluginCmdSet, (int)PkgCmdIDList.cmdidCheckMultiItemCppcheck);
191-
menuCheckSelections = new MenuCommand(onCheckSelectionsRequested, selectionsMenuCommandID);
192-
mcs.AddCommand(menuCheckSelections);
193-
}
188+
{
189+
CommandID stopCheckMenuCommandID = new CommandID(GuidList.guidCPPCheckPluginCmdSet, (int)PkgCmdIDList.cmdidStopCppcheck);
190+
menuCancelCheck = new MenuCommand(onStopCheckRequested, stopCheckMenuCommandID);
191+
mcs.AddCommand(menuCancelCheck);
192+
}
194193

195-
{
196-
CommandID projectMenuCommandID = new CommandID(GuidList.guidCPPCheckPluginProjectCmdSet, (int)PkgCmdIDList.cmdidCheckProjectCppcheck1);
197-
menuCheckCurrentProjectContext = new MenuCommand(onCheckCurrentProjectRequested, projectMenuCommandID);
198-
mcs.AddCommand(menuCheckCurrentProjectContext);
199-
}
194+
{
195+
CommandID selectionsMenuCommandID = new CommandID(GuidList.guidCPPCheckPluginCmdSet, (int)PkgCmdIDList.cmdidCheckMultiItemCppcheck);
196+
menuCheckSelections = new MenuCommand(onCheckSelectionsRequested, selectionsMenuCommandID);
197+
mcs.AddCommand(menuCheckSelections);
198+
}
200199

201-
{
202-
CommandID projectsMenuCommandID = new CommandID(GuidList.guidCPPCheckPluginMultiProjectCmdSet, (int)PkgCmdIDList.cmdidCheckProjectsCppcheck);
203-
menuCheckCurrentProjectsContext = new MenuCommand(onCheckAllProjectsRequested, projectsMenuCommandID);
204-
mcs.AddCommand(menuCheckCurrentProjectsContext);
205-
}
200+
{
201+
CommandID projectMenuCommandID = new CommandID(GuidList.guidCPPCheckPluginProjectCmdSet, (int)PkgCmdIDList.cmdidCheckProjectCppcheck1);
202+
menuCheckCurrentProjectContext = new MenuCommand(onCheckCurrentProjectRequested, projectMenuCommandID);
203+
mcs.AddCommand(menuCheckCurrentProjectContext);
204+
}
206205

207-
{
208-
CommandID selectionsMenuCommandID = new CommandID(GuidList.guidCPPCheckPluginMultiItemProjectCmdSet, (int)PkgCmdIDList.cmdidCheckMultiItemCppcheck1);
209-
checkMultiSelections = new MenuCommand(onCheckSelectionsRequested, selectionsMenuCommandID);
210-
mcs.AddCommand(checkMultiSelections);
211-
}
206+
{
207+
CommandID projectsMenuCommandID = new CommandID(GuidList.guidCPPCheckPluginMultiProjectCmdSet, (int)PkgCmdIDList.cmdidCheckProjectsCppcheck);
208+
menuCheckCurrentProjectsContext = new MenuCommand(onCheckAllProjectsRequested, projectsMenuCommandID);
209+
mcs.AddCommand(menuCheckCurrentProjectsContext);
210+
}
212211

213-
setMenuState(false);
212+
{
213+
CommandID selectionsMenuCommandID = new CommandID(GuidList.guidCPPCheckPluginMultiItemProjectCmdSet, (int)PkgCmdIDList.cmdidCheckMultiItemCppcheck1);
214+
checkMultiSelections = new MenuCommand(onCheckSelectionsRequested, selectionsMenuCommandID);
215+
mcs.AddCommand(checkMultiSelections);
214216
}
217+
218+
setMenuState(false);
215219
}
216220

217221
protected override void Dispose(bool disposing)

0 commit comments

Comments
 (0)