Skip to content

Commit

Permalink
add Options context menu
Browse files Browse the repository at this point in the history
fixes #1973
  • Loading branch information
ErikEJ committed Oct 24, 2023
1 parent c343999 commit 48ceb99
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,16 @@ protected override async System.Threading.Tasks.Task InitializeAsync(Cancellatio
menuCommandId14);
oleMenuCommandService.AddCommand(menuItem14);

var menuCommandId15 = new CommandID(
GuidList.GuidDbContextPackageCmdSet,
(int)PkgCmdIDList.cmdidOptions);
var menuItem15 = new OleMenuCommand(
OnProjectContextMenuInvokeHandler,
null,
OnProjectMenuBeforeQueryStatus,
menuCommandId15);
oleMenuCommandService.AddCommand(menuItem15);

var menuCommandId1101 = new CommandID(
GuidList.GuidReverseEngineerMenu,
(int)PkgCmdIDList.cmdidReverseEngineerEdit);
Expand Down Expand Up @@ -329,7 +339,8 @@ private async void OnProjectMenuBeforeQueryStatus(object sender, EventArgs e)
menuCommand.Visible = false;

if (menuCommand.CommandID.ID == PkgCmdIDList.cmdidDbDgml
|| menuCommand.CommandID.ID == PkgCmdIDList.cmdidAbout)
|| menuCommand.CommandID.ID == PkgCmdIDList.cmdidAbout
|| menuCommand.CommandID.ID == PkgCmdIDList.cmdidOptions)
{
menuCommand.Visible = true;
return;
Expand Down Expand Up @@ -525,6 +536,10 @@ private async void OnProjectContextMenuInvokeHandler(object sender, EventArgs e)
{
aboutHandler.ShowDialog();
}
else if (menuCommand.CommandID.ID == PkgCmdIDList.cmdidOptions)
{
ShowOptionPage(typeof(OptionsProvider.AdvancedOptions));
}
else if (menuCommand.CommandID.ID == PkgCmdIDList.cmdidDbCompare)
{
await compareHandler.HandleComparisonAsync(path, project);
Expand Down
12 changes: 12 additions & 0 deletions src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.en.vsct
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@
</Strings>
</Button>

<Button guid="guidDbContextPackageCmdSet" id="cmdidOptions" priority="0x0700" type="Button">
<Parent guid="guidDbContextPackageCmdSet" id="cmdidEdmAboutMenuItemsGroup" />
<Icon guid="ImageCatalogGuid" id="Settings" />
<CommandFlag>IconIsMoniker</CommandFlag>
<CommandFlag>DynamicVisibility</CommandFlag>
<Strings>
<CommandName>cmdidOptions</CommandName>
<ButtonText>Options</ButtonText>
</Strings>
</Button>

<Button guid="guidDbContextPackageCmdSet" id="cmdidT4Drop" priority="0x0250" type="Button">
<Parent guid="guidDbContextPackageCmdSet" id="cmdidEdmViewMenuItemsGroup" />
<Icon guid="ImageCatalogGuid" id="Template" />
Expand Down Expand Up @@ -274,6 +285,7 @@
<IDSymbol name="cmdidEdmProjectMenu" value="0x0003" />
<IDSymbol name="cmdidEdmProjectMenuGroup" value="0x0004" />
<IDSymbol name="cmdidAbout" value="0x0006" />
<IDSymbol name="cmdidOptions" value="0x0010" />
<IDSymbol name="cmdidMigrationStatus" value="0x0007" />
<IDSymbol name="cmdidDbCompare" value="0x0008" />
<IDSymbol name="cmdidDbDgml" value="0x0009" />
Expand Down
12 changes: 12 additions & 0 deletions src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.es.vsct
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@
</Strings>
</Button>

<Button guid="guidDbContextPackageCmdSet" id="cmdidOptions" priority="0x0700" type="Button">
<Parent guid="guidDbContextPackageCmdSet" id="cmdidEdmAboutMenuItemsGroup" />
<Icon guid="ImageCatalogGuid" id="Settings" />
<CommandFlag>IconIsMoniker</CommandFlag>
<CommandFlag>DynamicVisibility</CommandFlag>
<Strings>
<CommandName>cmdidOptions</CommandName>
<ButtonText>Options</ButtonText>
</Strings>
</Button>

<Button guid="guidDbContextPackageCmdSet" id="cmdidT4Drop" priority="0x0250" type="Button">
<Parent guid="guidDbContextPackageCmdSet" id="cmdidEdmViewMenuItemsGroup" />
<Icon guid="ImageCatalogGuid" id="Template" />
Expand Down Expand Up @@ -274,6 +285,7 @@
<IDSymbol name="cmdidEdmProjectMenu" value="0x0003" />
<IDSymbol name="cmdidEdmProjectMenuGroup" value="0x0004" />
<IDSymbol name="cmdidAbout" value="0x0006" />
<IDSymbol name="cmdidOptions" value="0x0010" />
<IDSymbol name="cmdidMigrationStatus" value="0x0007" />
<IDSymbol name="cmdidDbCompare" value="0x0008" />
<IDSymbol name="cmdidDbDgml" value="0x0009" />
Expand Down
12 changes: 12 additions & 0 deletions src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.it.vsct
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@
</Strings>
</Button>

<Button guid="guidDbContextPackageCmdSet" id="cmdidOptions" priority="0x0700" type="Button">
<Parent guid="guidDbContextPackageCmdSet" id="cmdidEdmAboutMenuItemsGroup" />
<Icon guid="ImageCatalogGuid" id="Settings" />
<CommandFlag>IconIsMoniker</CommandFlag>
<CommandFlag>DynamicVisibility</CommandFlag>
<Strings>
<CommandName>cmdidOptions</CommandName>
<ButtonText>Options</ButtonText>
</Strings>
</Button>

<Button guid="guidDbContextPackageCmdSet" id="cmdidT4Drop" priority="0x0250" type="Button">
<Parent guid="guidDbContextPackageCmdSet" id="cmdidEdmViewMenuItemsGroup" />
<Icon guid="ImageCatalogGuid" id="Template" />
Expand Down Expand Up @@ -275,6 +286,7 @@
<IDSymbol name="cmdidEdmProjectMenu" value="0x0003" />
<IDSymbol name="cmdidEdmProjectMenuGroup" value="0x0004" />
<IDSymbol name="cmdidAbout" value="0x0006" />
<IDSymbol name="cmdidOptions" value="0x0010" />
<IDSymbol name="cmdidMigrationStatus" value="0x0007" />
<IDSymbol name="cmdidDbCompare" value="0x0008" />
<IDSymbol name="cmdidDbDgml" value="0x0009" />
Expand Down
12 changes: 12 additions & 0 deletions src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.tr.vsct
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@
</Strings>
</Button>

<Button guid="guidDbContextPackageCmdSet" id="cmdidOptions" priority="0x0700" type="Button">
<Parent guid="guidDbContextPackageCmdSet" id="cmdidEdmAboutMenuItemsGroup" />
<Icon guid="ImageCatalogGuid" id="Settings" />
<CommandFlag>IconIsMoniker</CommandFlag>
<CommandFlag>DynamicVisibility</CommandFlag>
<Strings>
<CommandName>cmdidOptions</CommandName>
<ButtonText>Options</ButtonText>
</Strings>
</Button>

<Button guid="guidDbContextPackageCmdSet" id="cmdidT4Drop" priority="0x0250" type="Button">
<Parent guid="guidDbContextPackageCmdSet" id="cmdidEdmViewMenuItemsGroup" />
<Icon guid="ImageCatalogGuid" id="Template" />
Expand Down Expand Up @@ -275,6 +286,7 @@
<IDSymbol name="cmdidEdmProjectMenu" value="0x0003" />
<IDSymbol name="cmdidEdmProjectMenuGroup" value="0x0004" />
<IDSymbol name="cmdidAbout" value="0x0006" />
<IDSymbol name="cmdidOptions" value="0x0010" />
<IDSymbol name="cmdidMigrationStatus" value="0x0007" />
<IDSymbol name="cmdidDbCompare" value="0x0008" />
<IDSymbol name="cmdidDbDgml" value="0x0009" />
Expand Down
12 changes: 12 additions & 0 deletions src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.zh-Hans.vsct
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@
</Strings>
</Button>

<Button guid="guidDbContextPackageCmdSet" id="cmdidOptions" priority="0x0700" type="Button">
<Parent guid="guidDbContextPackageCmdSet" id="cmdidEdmAboutMenuItemsGroup" />
<Icon guid="ImageCatalogGuid" id="Settings" />
<CommandFlag>IconIsMoniker</CommandFlag>
<CommandFlag>DynamicVisibility</CommandFlag>
<Strings>
<CommandName>cmdidOptions</CommandName>
<ButtonText>Options</ButtonText>
</Strings>
</Button>

<Button guid="guidDbContextPackageCmdSet" id="cmdidT4Drop" priority="0x0250" type="Button">
<Parent guid="guidDbContextPackageCmdSet" id="cmdidEdmViewMenuItemsGroup" />
<Icon guid="ImageCatalogGuid" id="Template" />
Expand Down Expand Up @@ -274,6 +285,7 @@
<IDSymbol name="cmdidEdmProjectMenu" value="0x0003" />
<IDSymbol name="cmdidEdmProjectMenuGroup" value="0x0004" />
<IDSymbol name="cmdidAbout" value="0x0006" />
<IDSymbol name="cmdidOptions" value="0x0010" />
<IDSymbol name="cmdidMigrationStatus" value="0x0007" />
<IDSymbol name="cmdidDbCompare" value="0x0008" />
<IDSymbol name="cmdidDbDgml" value="0x0009" />
Expand Down
1 change: 1 addition & 0 deletions src/GUI/Shared/PkgCmdIDList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ internal static class PkgCmdIDList
public const uint cmdidDebugViewBuild = 0x0450;
public const uint cmdidDbCompare = 0x008;
public const uint cmdidDbDgml = 0x009;
public const uint cmdidOptions = 0x010;

// Database project menu
public const uint cmdidSqlprojCreate = 0x109;
Expand Down

0 comments on commit 48ceb99

Please sign in to comment.