Skip to content

Commit

Permalink
Fix menu item visibility issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikEJ committed May 15, 2024
1 parent c733ed8 commit d580af2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ private async void OnServerExplorerDatabaseBeforeQueryStatus(object sender, Even
}

menuCommand.Visible = false;
menuCommand.Enabled = false;

await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

Expand Down Expand Up @@ -526,19 +525,19 @@ private async void OnServerExplorerDatabaseBeforeQueryStatus(object sender, Even
return;
}

menuCommand.Visible = menuCommand.Enabled = await project.CanUseReverseEngineerAsync();
menuCommand.Visible = await project.CanUseReverseEngineerAsync();
return;
}

if (menuCommand.CommandID.ID == PkgCmdIDList.cmdidServerExplorerDiagram)
{
menuCommand.Visible = menuCommand.Enabled = true;
menuCommand.Visible = true;
return;
}

if (menuCommand.CommandID.ID == PkgCmdIDList.cmdidServerExplorerAnalyze)
{
menuCommand.Visible = menuCommand.Enabled = VsDataHelper.SqlServerProviders.Contains(connection.Provider);
menuCommand.Visible = VsDataHelper.SqlServerProviders.Contains(connection.Provider);
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.en.vsct
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>Analyze this! (preview)</ButtonText>
<ToolTipText>Run T-SQL static code analysis with an extensive set of rules</ToolTipText>
</Strings>
</Button>

Expand Down Expand Up @@ -268,6 +267,8 @@
<Parent guid="guidCRUDSPCommandsPackageCmdSet1" id="DatabaseMenuGroup" />
<Icon guid="ImageCatalogGuid" id="DatabaseScript" />
<CommandFlag>IconIsMoniker</CommandFlag>
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>EF Core Power Tools - Reverse Engineer</ButtonText>
</Strings>
Expand All @@ -277,6 +278,8 @@
<Parent guid="guidCRUDSPCommandsPackageCmdSet1" id="DatabaseMenuGroup" />
<Icon guid="ImageCatalogGuid" id="DatabaseAuditSpecification" />
<CommandFlag>IconIsMoniker</CommandFlag>
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>EF Core Power Tools - Generate ER Diagram</ButtonText>
</Strings>
Expand All @@ -286,6 +289,8 @@
<Parent guid="guidCRUDSPCommandsPackageCmdSet1" id="DatabaseMenuGroup" />
<Icon guid="ImageCatalogGuid" id="CodeInformationRule" />
<CommandFlag>IconIsMoniker</CommandFlag>
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>EF Core Power Tools - Analyze Database (experimental)</ButtonText>
</Strings>
Expand Down

0 comments on commit d580af2

Please sign in to comment.