Skip to content

Commit

Permalink
Merge pull request #51 from sboulema/feature/50-NuGetPackageManager
Browse files Browse the repository at this point in the history
Feature/50 nuget package manager
  • Loading branch information
sboulema authored Nov 25, 2024
2 parents d4bcb94 + 6e9f9d1 commit a314088
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/NuGetMonitor/Options/GeneralOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,11 @@ public sealed class GeneralOptions : BaseOptionModel<GeneralOptions>
[Description("Show a notification detailing vulnerable transitive packages.")]
[DefaultValue(true)]
public bool ShowTransitivePackagesIssues { get; set; } = true;

[Category("Notifications")]
[DisplayName("Open NuGet Package Manager")]
[Description("Open the built-in NuGet Package Manager instead of the NuGet Monitor Package Manager.")]
[DefaultValue(true)]
public bool OpenNuGetPackageManager { get; set; } = false;
}

14 changes: 13 additions & 1 deletion src/NuGetMonitor/Services/InfoBarService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private static void InfoBar_ActionItemClicked(object sender, InfoBarActionItemEv
switch (e.ActionItem.ActionContext)
{
case Actions.Manage:
NuGetMonitorCommands.Instance?.ShowMonitorToolWindow();
OpenNuGetPackageManager();
break;

case ICollection<TransitiveDependencies> transitiveDependencies:
Expand All @@ -129,6 +129,18 @@ private static void InfoBar_ActionItemClicked(object sender, InfoBarActionItemEv
}
}

private static void OpenNuGetPackageManager()
{
if (GeneralOptions.Instance.OpenNuGetPackageManager)
{
VS.Commands.ExecuteAsync("Tools.ManageNuGetPackagesForSolution").FireAndForget();
}
else
{
NuGetMonitorCommands.Instance?.ShowMonitorToolWindow();
}
}

private static void PrintDependencyTree(IEnumerable<TransitiveDependencies> dependencies)
{
var text = new StringBuilder();
Expand Down

0 comments on commit a314088

Please sign in to comment.