From 90c3f57e01ce1943aa240f712aa7fa4ced240a0e Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 14 Feb 2026 21:40:29 +0100 Subject: [PATCH 1/5] LICENSE.md --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 997bb32..409e112 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 bytecode77 +Copyright (c) 2026 bytecode77 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 67885d733993b302fcf19393f7c5aec1b7a5a7c5 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Tue, 10 Mar 2026 17:05:08 +0100 Subject: [PATCH 2/5] + BytecodeApi.Wpf.Converters.TimeOnlyConverter --- .../Controls/UiToggleSwitch.xaml | 3 + .../Converters/TimeOnlyConverter.cs | 77 +++++++++++++++++++ .../Converters/TimeOnlyConverterMethod.cs | 24 ++++++ Playground.Wpf.Cui/MainWindow.xaml | 2 +- 4 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 BytecodeApi.Wpf/Converters/TimeOnlyConverter.cs create mode 100644 BytecodeApi.Wpf/Converters/TimeOnlyConverterMethod.cs diff --git a/BytecodeApi.Wpf.Cui/Controls/UiToggleSwitch.xaml b/BytecodeApi.Wpf.Cui/Controls/UiToggleSwitch.xaml index 79699b6..fa07d36 100644 --- a/BytecodeApi.Wpf.Cui/Controls/UiToggleSwitch.xaml +++ b/BytecodeApi.Wpf.Cui/Controls/UiToggleSwitch.xaml @@ -81,6 +81,9 @@ + + + diff --git a/BytecodeApi.Wpf/Converters/TimeOnlyConverter.cs b/BytecodeApi.Wpf/Converters/TimeOnlyConverter.cs new file mode 100644 index 0000000..4ddabf0 --- /dev/null +++ b/BytecodeApi.Wpf/Converters/TimeOnlyConverter.cs @@ -0,0 +1,77 @@ +using BytecodeApi.Extensions; +using System.Windows; + +namespace BytecodeApi.Wpf.Converters; + +/// +/// Represents the converter that converts ? values. The method returns a based on the specified parameter. +/// +public sealed class TimeOnlyConverter : TwoWayConverterBase +{ + /// + /// Specifies the method that is used to convert the ? value. + /// + public TimeOnlyConverterMethod Method { get; set; } + + /// + /// Initializes a new instance of the class with the specified conversion method. + /// + /// The method that is used to convert the ? value. + public TimeOnlyConverter(TimeOnlyConverterMethod method) + { + Method = method; + } + + /// + /// Converts the ? value based on the specified parameter. + /// + /// The ? value to convert. + /// A parameter that specifies the format used in some of the methods. + /// + /// A with the result of the conversion. + /// + public override object? Convert(TimeOnly? value, string? parameter) + { + if (value == null) + { + return null; + } + else + { + return Method switch + { + TimeOnlyConverterMethod.Hour => value.Value.Hour.ToString(), + TimeOnlyConverterMethod.Minute => value.Value.Minute.ToString(), + TimeOnlyConverterMethod.Second => value.Value.Second.ToString(), + TimeOnlyConverterMethod.Format => value.Value.ToStringInvariant(parameter ?? ""), + _ => throw Throw.InvalidEnumArgument(nameof(Method), Method) + }; + } + } + /// + /// Converts a value back to its corresponding ? value. + /// + /// The value to convert back. + /// A parameter that specifies the format used in some of the methods. + /// + /// A ? with the result of the conversion. + /// + public override object? ConvertBack(object? value, string? parameter) + { + if (value == null) + { + return null; + } + else + { + return Method switch + { + TimeOnlyConverterMethod.Hour or + TimeOnlyConverterMethod.Minute or + TimeOnlyConverterMethod.Second => DependencyProperty.UnsetValue, + TimeOnlyConverterMethod.Format => (value as string)?.ToTimeOnly(parameter ?? ""), + _ => throw Throw.InvalidEnumArgument(nameof(Method), Method) + }; + } + } +} \ No newline at end of file diff --git a/BytecodeApi.Wpf/Converters/TimeOnlyConverterMethod.cs b/BytecodeApi.Wpf/Converters/TimeOnlyConverterMethod.cs new file mode 100644 index 0000000..a73d6bc --- /dev/null +++ b/BytecodeApi.Wpf/Converters/TimeOnlyConverterMethod.cs @@ -0,0 +1,24 @@ +namespace BytecodeApi.Wpf.Converters; + +/// +/// Specifies the method that is used to convert ? values. +/// +public enum TimeOnlyConverterMethod +{ + /// + /// Returns the hour component of the ? value as a . + /// + Hour, + /// + /// Returns the minute component of the ? value as a . + /// + Minute, + /// + /// Returns the second component of the ? value as a . + /// + Second, + /// + /// Returns the equivalent representation of the ? value using a specified format parameter and the invariant culture. + /// + Format +} \ No newline at end of file diff --git a/Playground.Wpf.Cui/MainWindow.xaml b/Playground.Wpf.Cui/MainWindow.xaml index bad9eae..a5633be 100644 --- a/Playground.Wpf.Cui/MainWindow.xaml +++ b/Playground.Wpf.Cui/MainWindow.xaml @@ -306,7 +306,7 @@ - + From a26f3ad5f5b6dd1b8f90c50487ff195af6dc5c87 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Mon, 16 Mar 2026 11:16:25 +0100 Subject: [PATCH 3/5] BytecodeApi.Wpf.Cui.Controls.UiToggleSwitch visual bugfix --- .../Controls/UiToggleSwitch.xaml | 57 +++++++++++++------ 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/BytecodeApi.Wpf.Cui/Controls/UiToggleSwitch.xaml b/BytecodeApi.Wpf.Cui/Controls/UiToggleSwitch.xaml index fa07d36..8651aa2 100644 --- a/BytecodeApi.Wpf.Cui/Controls/UiToggleSwitch.xaml +++ b/BytecodeApi.Wpf.Cui/Controls/UiToggleSwitch.xaml @@ -15,9 +15,20 @@ - - - + + + + + + + + + + + + + + @@ -46,41 +57,53 @@ - - + + + + + + - - + + - - - - + + + + + + + + - - + + - - - + + + + + + + - + From a396c42b2dbd759549a8e3c98a871a674a53f900 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Wed, 18 Mar 2026 21:53:02 +0100 Subject: [PATCH 4/5] + EnumerableExtensions.WhenAll --- .../Extensions/EnumerableExtensions.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/BytecodeApi/Extensions/EnumerableExtensions.cs b/BytecodeApi/Extensions/EnumerableExtensions.cs index 7a58cc0..e1c81eb 100644 --- a/BytecodeApi/Extensions/EnumerableExtensions.cs +++ b/BytecodeApi/Extensions/EnumerableExtensions.cs @@ -782,4 +782,32 @@ public static void ForEach(this IEnumerable source, Action + /// Creates a task that will complete when all tasks ihave completed. + /// + /// The tasks to await. + /// + /// A task that represents the completion of all tasks. + /// + public static Task WhenAll(this IEnumerable tasks) + { + Check.ArgumentNull(tasks); + + return Task.WhenAll(tasks); + } + /// + /// Creates a task that will complete when all tasks ihave completed. + /// + /// The type of the tasks to await. + /// The tasks to await. + /// + /// A task that represents the completion of all tasks. + /// + public static Task WhenAll(this IEnumerable> tasks) + { + Check.ArgumentNull(tasks); + + return Task.WhenAll(tasks); + } } \ No newline at end of file From 1017a88dd37c695323e6a3cca76eab5d70691fb4 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Wed, 25 Mar 2026 22:13:02 +0100 Subject: [PATCH 5/5] + GenericRestClient: Expose protected properties --- BytecodeApi.Rest/GenericRestClient.cs | 13 +++++++++++++ Playground.Console/ExecuteAttribute.cs | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/BytecodeApi.Rest/GenericRestClient.cs b/BytecodeApi.Rest/GenericRestClient.cs index bf8ef5c..9a8557e 100644 --- a/BytecodeApi.Rest/GenericRestClient.cs +++ b/BytecodeApi.Rest/GenericRestClient.cs @@ -10,6 +10,19 @@ public class GenericRestClient : RestClient /// public static GenericRestClient Instance { get; } + /// + /// A object with options for REST requests. + /// + new public RestRequestOptions RequestOptions + { + get => base.RequestOptions; + set => base.RequestOptions = value; + } + /// + /// Gets the that is used to process requests. + /// + new public HttpClient HttpClient => base.HttpClient; + static GenericRestClient() { Instance = new(); diff --git a/Playground.Console/ExecuteAttribute.cs b/Playground.Console/ExecuteAttribute.cs index 336472b..4e5eb20 100644 --- a/Playground.Console/ExecuteAttribute.cs +++ b/Playground.Console/ExecuteAttribute.cs @@ -1,7 +1,7 @@ /// /// This method will be executed. The method must have either no parameters, or a [] parameter. /// -[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] +[AttributeUsage(AttributeTargets.Method)] public sealed class ExecuteAttribute : Attribute { } \ No newline at end of file