Bug fixes

This commit is contained in:
TheXamlGuy
2024-07-05 21:57:01 +01:00
parent f937a1d999
commit 5654b86cea
10 changed files with 27 additions and 24 deletions
-8
View File
@@ -1,8 +0,0 @@
namespace Toolkit.Foundation;
public record Activate
{
public static ActivateEventArgs<TSender> As<TSender>(TSender sender) => new(sender);
public static ActivateEventArgs<TSender> As<TSender>() where TSender : new() => new(new TSender());
}
-3
View File
@@ -1,3 +0,0 @@
namespace Toolkit.Foundation;
public record ActivateEventArgs<TSender>(TSender? Sender = default);
+8
View File
@@ -0,0 +1,8 @@
namespace Toolkit.Foundation;
public record Close
{
public static CloseEventArgs<TSender> As<TSender>(TSender sender) => new(sender);
public static CloseEventArgs<TSender> As<TSender>() where TSender : new() => new(new TSender());
}
+3
View File
@@ -0,0 +1,3 @@
namespace Toolkit.Foundation;
public record CloseEventArgs<TSender>(TSender? Sender = default);
-1
View File
@@ -51,7 +51,6 @@ public class ComponentBuilder :
where TConfiguration : ComponentConfiguration, new() where TConfiguration : ComponentConfiguration, new()
{ {
TConfiguration configuration = new(); TConfiguration configuration = new();
if (configurationDelegate is not null) if (configurationDelegate is not null)
{ {
configurationDelegate(configuration); configurationDelegate(configuration);
+1 -8
View File
@@ -74,14 +74,7 @@ public class ConfigurationSource<TConfiguration>(IConfigurationFile<TConfigurati
string currentKey = segments[i]; string currentKey = segments[i];
if (currentNode[currentKey] is null) if (currentNode[currentKey] is null)
{ {
if (int.TryParse(segments[i + 1], out int _)) currentNode[currentKey] = new JsonObject();
{
currentNode[currentKey] = new JsonArray();
}
else
{
currentNode[currentKey] = new JsonObject();
}
} }
currentNode = currentNode[currentKey]; currentNode = currentNode[currentKey];
+2 -2
View File
@@ -3,7 +3,7 @@
public class DecoratorService<T> : public class DecoratorService<T> :
IDecoratorService<T> IDecoratorService<T>
{ {
public T? Service { get; private set; } public T? Value { get; private set; }
public void Set(T value) => Service = value; public void Set(T? value) => Value = value;
} }
+2 -2
View File
@@ -2,7 +2,7 @@
public interface IDecoratorService<T> public interface IDecoratorService<T>
{ {
T? Service { get; } T? Value { get; }
void Set(T service); void Set(T? value);
} }
+8
View File
@@ -0,0 +1,8 @@
namespace Toolkit.Foundation;
public record Open
{
public static OpenEventArgs<TSender> As<TSender>(TSender sender) => new(sender);
public static OpenEventArgs<TSender> As<TSender>() where TSender : new() => new(new TSender());
}
+3
View File
@@ -0,0 +1,3 @@
namespace Toolkit.Foundation;
public record OpenEventArgs<TSender>(TSender? Sender = default);