Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
run: nbgv get-version

- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
dotnet-version: '10.x'

- name: Restore packages
run: dotnet restore
Expand Down Expand Up @@ -60,9 +60,9 @@ jobs:
name: push-to-nuget-org
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
dotnet-version: '10.x'

- name: Download artifacts
uses: actions/download-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions ConsoleTools/BootstrapperExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public static class BootstrapperExtensions
{

//Microsoft.Extensions.DependencyInjection
[Obsolete("Use aemarcoCommons.ToolboxConsole instead.")]
public static ITypeRegistrar ToTypeRegistrar(this IServiceCollection services) =>
new SpectreInfrastructure.ServiceCollectionTypeRegistrar(services);

Expand Down
1 change: 1 addition & 0 deletions ConsoleTools/Interop/PowerShellHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace aemarcoCommons.ConsoleTools.Interop;

public static class PowerShellHelper
{
[Obsolete("Use aemarcoCommons.ToolboxConsole.Shell.PowerShellHelper instead.")]
public static async Task RunCommand(
string command,
params string[] args)
Expand Down
4 changes: 4 additions & 0 deletions ConsoleTools/Menu/ConsoleMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// ReSharper disable once CheckNamespace
namespace aemarcoCommons.ConsoleTools;

[Obsolete("Use aemarcoCommons.ToolboxConsole instead.")]
public class ConsoleMenu
{
private readonly ConsoleMenuItem[] _menuItems;
Expand Down Expand Up @@ -120,6 +121,7 @@ private void WriteConsoleItem(int itemIndex, int selectedItemIndex)
}
}

[Obsolete("Use aemarcoCommons.ToolboxConsole instead.")]
public abstract class ConsoleMenuItem
{
protected ConsoleMenuItem(string label)
Expand All @@ -131,6 +133,7 @@ public virtual void Execute() { }
public virtual Task ExecuteAsync() => Task.CompletedTask;
}

[Obsolete("Use aemarcoCommons.ToolboxConsole instead.")]
public class ConsoleMenuItem<T> : ConsoleMenuItem
{
private readonly Action<T?>? _callBack;
Expand Down Expand Up @@ -165,6 +168,7 @@ public override async Task ExecuteAsync()
}
}

[Obsolete("Use aemarcoCommons.ToolboxConsole instead.")]
public class ConsoleMenuSeparator : ConsoleMenuItem
{
public ConsoleMenuSeparator(char separatorChar = '-')
Expand Down
1 change: 1 addition & 0 deletions ConsoleTools/Power/Commands/Position.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace aemarcoCommons.ConsoleTools;

public static partial class PowerConsole
{
[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static void ClearCurrentLine()
{
var currentLineCursor = Console.CursorTop;
Expand Down
2 changes: 2 additions & 0 deletions ConsoleTools/Power/Commands/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ namespace aemarcoCommons.ConsoleTools;
public static partial class PowerConsole
{

[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
[SupportedOSPlatform("windows")]
public static void ShowWindow()
{
WindowVisibility.Show();
}

[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
[SupportedOSPlatform("windows")]
public static void HideWindow()
{
Expand Down
2 changes: 2 additions & 0 deletions ConsoleTools/Power/Input/ClassBasedSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static partial class PowerConsole
/// <param name="displayProperty">Displayed as</param>
/// <returns>Selected item</returns>

[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static T EnsureSelection<T>(string header, IEnumerable<T> selectable, Func<T, string> displayProperty)
where T : class
{
Expand All @@ -34,6 +35,7 @@ public static T EnsureSelection<T>(string header, IEnumerable<T> selectable, Fun
/// <param name="displayProperty">Displayed as</param>
/// <returns>Selected item or null on abort</returns>

[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static T? AbortableSelection<T>(string header, IEnumerable<T> selectable, Func<T, string> displayProperty)
where T : class
{
Expand Down
1 change: 1 addition & 0 deletions ConsoleTools/Power/Input/Decision.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public static partial class PowerConsole
/// /// <param name="question">question to ask</param>
/// /// <param name="clear">clear console before asking</param>
/// <returns>true if decision is Yes</returns>
[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static bool EnsureDecision(string question, bool clear = true)
{
if (clear)
Expand Down
1 change: 1 addition & 0 deletions ConsoleTools/Power/Input/InputHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace aemarcoCommons.ConsoleTools;

public static partial class PowerConsole
{
[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
private static T? MenuSelectionHelper<T>(string header, IEnumerable<T> selectable, Func<T, string> displayProperty, bool abortable, bool clear = true)
where T : class
{
Expand Down
2 changes: 2 additions & 0 deletions ConsoleTools/Power/Input/Numbers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static partial class PowerConsole
/// <param name="max">inclusive maximum of the range</param>
/// <param name="clear">console should be cleared?</param>
/// <returns>input number in range</returns>
[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static int EnsureIntInput(string prompt, int min = int.MinValue, int max = int.MaxValue, bool clear = false)
{
if (clear)
Expand Down Expand Up @@ -41,6 +42,7 @@ public static int EnsureIntInput(string prompt, int min = int.MinValue, int max
/// <param name="max">inclusive maximum of the range</param>
/// <param name="clear">console should be cleared?</param>
/// <returns>nullable input number in range</returns>
[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static int? EnsureNullableIntInput(string prompt, int min = int.MinValue, int max = int.MaxValue, bool clear = false)
{
if (clear)
Expand Down
4 changes: 4 additions & 0 deletions ConsoleTools/Power/Input/PathNavigation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public static partial class PowerConsole
/// <param name="includedServers">servers to include for share selection</param>
/// <param name="showHidden">shot hidden folders</param>
/// <returns>selected path</returns>
[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static string PathSelector(string path, IEnumerable<string>? includedServers = null, bool showHidden = false)
{
var serverItems = includedServers?.Distinct().ToArray();
Expand Down Expand Up @@ -71,6 +72,7 @@ x is null
/// Selection of a drive in a ConsoleMenu
/// </summary>
/// <returns></returns>
[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static string DriveSelector(IEnumerable<string>? servers = null)
{
string? path = null;
Expand Down Expand Up @@ -109,6 +111,7 @@ public static string DriveSelector(IEnumerable<string>? servers = null)
/// </summary>
/// <param name="servers">servers which can be selected</param>
/// <returns></returns>
[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
[SupportedOSPlatform("windows")]
public static string? ServerSelector(IEnumerable<string> servers)
{
Expand All @@ -129,6 +132,7 @@ public static string DriveSelector(IEnumerable<string>? servers = null)
/// Selection of a share for given server
/// </summary>
/// <returns>unc path to share or null when no shares are available</returns>
[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
[SupportedOSPlatform("windows")]
public static string? ShareSelector(string? server)
{
Expand Down
1 change: 1 addition & 0 deletions ConsoleTools/Power/Input/Text.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static partial class PowerConsole
/// <param name="minLength">min length</param>
/// <param name="clear">console should be cleared?</param>
/// <returns>input string</returns>
[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static string EnsureTextInput(string prompt, int minLength = 1, bool clear = false)
{
if (clear)
Expand Down
1 change: 1 addition & 0 deletions ConsoleTools/Power/Spectre/Json.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace aemarcoCommons.ConsoleTools;

public static partial class PowerConsole
{
[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static void WriteAsJson(object o)
{
AnsiConsole.Write(new JsonText(JsonConvert.SerializeObject(o)));
Expand Down
5 changes: 5 additions & 0 deletions ConsoleTools/Power/Spectre/Progress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace aemarcoCommons.ConsoleTools;
public static partial class PowerConsole
{

[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static void StartProgress(Action<ProgressContext> work)
{
AnsiConsole.Progress()
Expand All @@ -19,6 +20,7 @@ public static void StartProgress(Action<ProgressContext> work)
.Start(work);
}

[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static T StartProgress<T>(Func<ProgressContext, T> work)
{
return AnsiConsole.Progress()
Expand All @@ -32,6 +34,7 @@ public static T StartProgress<T>(Func<ProgressContext, T> work)
}


[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static async Task StartProgressAsync(Func<ProgressContext, Task> work)
{
await AnsiConsole.Progress()
Expand All @@ -44,6 +47,7 @@ await AnsiConsole.Progress()
.StartAsync(work);
}

[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static async Task StartProgressAsync<T>(
Func<ProgressContext, T, CancellationToken, Task> work,
T request,
Expand All @@ -54,6 +58,7 @@ await StartProgressAsync(async ctx =>
}


[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static async Task<T> StartProgressAsync<T>(Func<ProgressContext, Task<T>> work)
{
return await AnsiConsole.Progress()
Expand Down
1 change: 1 addition & 0 deletions ConsoleTools/Power/Spectre/ProgressTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace aemarcoCommons.ConsoleTools;
public static partial class PowerConsole
{

[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static void CompleteTask(this ProgressTask task)
{
task.Value = task.MaxValue;
Expand Down
1 change: 1 addition & 0 deletions ConsoleTools/Power/Spectre/Status.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace aemarcoCommons.ConsoleTools;

public static partial class PowerConsole
{
[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static async Task<T> StartStatusAsync<T>(
Func<StatusContext, Task<T>> work)
{
Expand Down
1 change: 1 addition & 0 deletions ConsoleTools/Progress/ConsoleInlineProgressBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace aemarcoCommons.ConsoleTools;
/// <summary>
/// This progress bar fits, if console outputs are written in between progress steps
/// </summary>
[Obsolete("Use Spectre.Console progress via PowerConsole.StartProgress in aemarcoCommons.ToolboxConsole instead.")]
public class ConsoleInlineProgressBar : ConsoleProgressBar
{
public override void UpdateProgress(long done, long total)
Expand Down
2 changes: 2 additions & 0 deletions ConsoleTools/Progress/ConsoleProgressBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// ReSharper disable once CheckNamespace
namespace aemarcoCommons.ConsoleTools;

[Obsolete("Use Spectre.Console progress via PowerConsole.StartProgress in aemarcoCommons.ToolboxConsole instead.")]
public abstract class ConsoleProgressBar
{
public abstract void UpdateProgress(long done, long total);
Expand Down Expand Up @@ -88,6 +89,7 @@ protected void DrawProgressLine(long done, long total)
/// <summary>
/// This progress bar fits, if no console outputs are written in between progress steps
/// </summary>
[Obsolete("Use Spectre.Console progress via PowerConsole.StartProgress in aemarcoCommons.ToolboxConsole instead.")]
public class ConsoleOneLineProgressBar : ConsoleProgressBar
{
public override void UpdateProgress(long done, long total)
Expand Down
1 change: 1 addition & 0 deletions ConsoleTools/Progress/ConsoleTopProgressBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace aemarcoCommons.ConsoleTools;
/// This progress bar fits, if a lot of console outputs are written in between progress steps.
/// Place the number of max. lines of content in between steps into the constructor. defaults to 1.
/// </summary>
[Obsolete("Use Spectre.Console progress via PowerConsole.StartProgress in aemarcoCommons.ToolboxConsole instead.")]
public class ConsoleTopProgressBar : ConsoleProgressBar
{
private readonly int _contentHeight;
Expand Down
6 changes: 5 additions & 1 deletion ConsoleTools/SpectreHost/HostApplicationBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
namespace aemarcoCommons.ConsoleTools.SpectreHost;



[Obsolete("Use aemarcoCommons.ToolboxConsole.PowerConsole instead.")]
public static class HostApplicationBuilderExtensions
{

private static AppTypeRegistrar? _registrar;
[Obsolete("Use aemarcoCommons.ToolboxConsole instead.")]
public static async Task RunAsSpectreCommandApp(
this HostApplicationBuilder app,
Action<IConfigurator>? configureCommandApp = null)
Expand All @@ -26,6 +27,7 @@ await app.RunCommandApp(
(_, x) => configureCommandApp?.Invoke(x));
}

[Obsolete("Use aemarcoCommons.ToolboxConsole instead.")]
public static async Task RunAsSpectreCommandApp<TDefaultCommand>(
this HostApplicationBuilder app,
Action<IConfigurator>? configureCommandApp = null)
Expand All @@ -39,6 +41,7 @@ await app.RunCommandApp(
}


[Obsolete("Use aemarcoCommons.ToolboxConsole instead.")]
public static async Task RunAsSpectreCommandApp(
this HostApplicationBuilder app,
Action<HostApplicationBuilder, IConfigurator>? configureCommandApp = null)
Expand All @@ -47,6 +50,7 @@ public static async Task RunAsSpectreCommandApp(
var commandApp = new CommandApp(_registrar);
await app.RunCommandApp(commandApp, configureCommandApp);
}
[Obsolete("Use aemarcoCommons.ToolboxConsole instead.")]
public static async Task RunAsSpectreCommandApp<TDefaultCommand>(
this HostApplicationBuilder app,
Action<HostApplicationBuilder, IConfigurator>? configureCommandApp = null)
Expand Down
1 change: 1 addition & 0 deletions ConsoleTools/SpectreInfrastructure/AppTypeRegistrar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace aemarcoCommons.ConsoleTools.SpectreInfrastructure;

[Obsolete("Use aemarcoCommons.ToolboxConsole instead.")]
public sealed class AppTypeRegistrar : ITypeRegistrar
{
private readonly HostApplicationBuilder _builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace aemarcoCommons.ConsoleTools.SpectreInfrastructure;
//https://spectreconsole.net/cli/commandapp
//https://github.com/spectreconsole/examples/blob/main/examples/Cli/Injection/Infrastructure/TypeRegistrar.cs

[Obsolete("Use aemarcoCommons.ToolboxConsole instead.")]
public sealed class ServiceCollectionTypeRegistrar : ITypeRegistrar
{
private readonly IServiceCollection _builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace aemarcoCommons.ConsoleTools.SpectreInfrastructure;
//https://spectreconsole.net/cli/commandapp
//https://github.com/spectreconsole/examples/blob/main/examples/Cli/Injection/Infrastructure/TypeResolver.cs

[Obsolete("Use aemarcoCommons.ToolboxConsole instead.")]
public sealed class ServiceCollectionTypeResolver : ITypeResolver, IDisposable
{
private readonly IServiceProvider _provider;
Expand Down
Loading
Loading