diff --git a/Toolkit.Foundation/Activate.cs b/Toolkit.Foundation/Activate.cs index 15a20be..870a837 100644 --- a/Toolkit.Foundation/Activate.cs +++ b/Toolkit.Foundation/Activate.cs @@ -2,7 +2,7 @@ public record Activate { - public static ActivateEventArgs As(TSender sender) => new(sender); + public static ActivateEventArgs As(TValue value) => new(value); - public static ActivateEventArgs As() where TSender : new() => new(new TSender()); + public static ActivateEventArgs As() where TValue : new() => new(new TValue()); } diff --git a/Toolkit.Foundation/ActivateEventArgs.cs b/Toolkit.Foundation/ActivateEventArgs.cs index 5401a06..3ffe8e2 100644 --- a/Toolkit.Foundation/ActivateEventArgs.cs +++ b/Toolkit.Foundation/ActivateEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record ActivateEventArgs +public record ActivateEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public ActivateEventArgs(TSender sender) + public ActivateEventArgs(TValue value) { - Sender = sender; + Value = value; } public ActivateEventArgs() diff --git a/Toolkit.Foundation/Activated.cs b/Toolkit.Foundation/Activated.cs index adfb47e..b11a16e 100644 --- a/Toolkit.Foundation/Activated.cs +++ b/Toolkit.Foundation/Activated.cs @@ -2,7 +2,7 @@ public record Activated { - public static ActivatedEventArgs As(TSender sender) => new(sender); + public static ActivatedEventArgs As(TValue value) => new(value); - public static ActivatedEventArgs As() where TSender : new() => new(new TSender()); + public static ActivatedEventArgs As() where TValue : new() => new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/ActivatedEventArgs.cs b/Toolkit.Foundation/ActivatedEventArgs.cs index c6f0c39..59fc0ac 100644 --- a/Toolkit.Foundation/ActivatedEventArgs.cs +++ b/Toolkit.Foundation/ActivatedEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record ActivatedEventArgs +public record ActivatedEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public ActivatedEventArgs(TSender sender) + public ActivatedEventArgs(TValue value) { - Sender = sender; + Value = value; } public ActivatedEventArgs() diff --git a/Toolkit.Foundation/Cancel.cs b/Toolkit.Foundation/Cancel.cs index 1bfb291..4c56c26 100644 --- a/Toolkit.Foundation/Cancel.cs +++ b/Toolkit.Foundation/Cancel.cs @@ -2,7 +2,7 @@ public record Cancel { - public static CancelEventArgs As(TSender sender) => new(sender); + public static CancelEventArgs As(TValue value) => new(value); - public static CancelEventArgs As() where TSender : new() => new(new TSender()); + public static CancelEventArgs As() where TValue : new() => new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/CancelEventArgs.cs b/Toolkit.Foundation/CancelEventArgs.cs index 7c0ef87..e4cb6d4 100644 --- a/Toolkit.Foundation/CancelEventArgs.cs +++ b/Toolkit.Foundation/CancelEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record CancelEventArgs +public record CancelEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public CancelEventArgs(TSender sender) + public CancelEventArgs(TValue value) { - Sender = sender; + Value = value; } public CancelEventArgs() diff --git a/Toolkit.Foundation/Changed.cs b/Toolkit.Foundation/Changed.cs index c8f538b..be8dda9 100644 --- a/Toolkit.Foundation/Changed.cs +++ b/Toolkit.Foundation/Changed.cs @@ -2,7 +2,7 @@ public record Changed { - public static ChangedEventArgs As(TSender sender) => new(sender); + public static ChangedEventArgs As(TValue value) => new(value); - public static ChangedEventArgs As() where TSender : new() => new(new TSender()); + public static ChangedEventArgs As() where TValue : new() => new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/ChangedEventArgs.cs b/Toolkit.Foundation/ChangedEventArgs.cs index f64ec9d..5fbb3fe 100644 --- a/Toolkit.Foundation/ChangedEventArgs.cs +++ b/Toolkit.Foundation/ChangedEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record ChangedEventArgs +public record ChangedEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public ChangedEventArgs(TSender sender) + public ChangedEventArgs(TValue value) { - Sender = sender; + Value = value; } public ChangedEventArgs() diff --git a/Toolkit.Foundation/Close.cs b/Toolkit.Foundation/Close.cs index bfa1f05..031d689 100644 --- a/Toolkit.Foundation/Close.cs +++ b/Toolkit.Foundation/Close.cs @@ -2,7 +2,7 @@ public record Close { - public static CloseEventArgs As(TSender sender) => new(sender); + public static CloseEventArgs As(TValue value) => new(value); - public static CloseEventArgs As() where TSender : new() => new(new TSender()); + public static CloseEventArgs As() where TValue : new() => new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/CloseEventArgs.cs b/Toolkit.Foundation/CloseEventArgs.cs index 669ca78..948c4d7 100644 --- a/Toolkit.Foundation/CloseEventArgs.cs +++ b/Toolkit.Foundation/CloseEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record CloseEventArgs +public record CloseEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public CloseEventArgs(TSender sender) + public CloseEventArgs(TValue value) { - Sender = sender; + Value = value; } public CloseEventArgs() diff --git a/Toolkit.Foundation/Closed.cs b/Toolkit.Foundation/Closed.cs index 0ae6bd1..6d7e8a3 100644 --- a/Toolkit.Foundation/Closed.cs +++ b/Toolkit.Foundation/Closed.cs @@ -2,8 +2,8 @@ public record Closed { - public static ClosedEventArgs As(TSender sender) => new(sender); + public static ClosedEventArgs As(TValue value) => new(value); - public static ClosedEventArgs As() where TSender : new() => new(new TSender()); + public static ClosedEventArgs As() where TValue : new() => new(new TValue()); } diff --git a/Toolkit.Foundation/ClosedEventArgs.cs b/Toolkit.Foundation/ClosedEventArgs.cs index 989be8c..fd135f1 100644 --- a/Toolkit.Foundation/ClosedEventArgs.cs +++ b/Toolkit.Foundation/ClosedEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record ClosedEventArgs +public record ClosedEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public ClosedEventArgs(TSender sender) + public ClosedEventArgs(TValue value) { - Sender = sender; + Value = value; } public ClosedEventArgs() diff --git a/Toolkit.Foundation/ConfigurationChangedHandler.cs b/Toolkit.Foundation/ConfigurationChangedHandler.cs index 5419287..dd3e97d 100644 --- a/Toolkit.Foundation/ConfigurationChangedHandler.cs +++ b/Toolkit.Foundation/ConfigurationChangedHandler.cs @@ -7,7 +7,7 @@ public class ConfigurationChangedHandler(ConfigurationVa { public void Handle(ChangedEventArgs args) { - if (args.Sender is TConfiguration configuration) + if (args.Value is TConfiguration configuration) { if (configurationValue.TryUpdate(configuration, out TValue value)) { diff --git a/Toolkit.Foundation/ConfirmEventArgs.cs b/Toolkit.Foundation/ConfirmEventArgs.cs index 129e177..96b11b5 100644 --- a/Toolkit.Foundation/ConfirmEventArgs.cs +++ b/Toolkit.Foundation/ConfirmEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record ConfirmEventArgs +public record ConfirmEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public ConfirmEventArgs(TSender sender) + public ConfirmEventArgs(TValue value) { - Sender = sender; + Value = value; } public ConfirmEventArgs() diff --git a/Toolkit.Foundation/Count.cs b/Toolkit.Foundation/Count.cs index 9563a8d..d2dd968 100644 --- a/Toolkit.Foundation/Count.cs +++ b/Toolkit.Foundation/Count.cs @@ -2,9 +2,9 @@ public record Count { - public static CountEventArgs As(TSender sender) => - new(sender); + public static CountEventArgs As(TValue value) => + new(value); - public static CountEventArgs As() where TSender : new() => - new(new TSender()); + public static CountEventArgs As() where TValue : new() => + new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/CountEventArgs.cs b/Toolkit.Foundation/CountEventArgs.cs index 0e25519..7e3bfe8 100644 --- a/Toolkit.Foundation/CountEventArgs.cs +++ b/Toolkit.Foundation/CountEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record CountEventArgs +public record CountEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public CountEventArgs(TSender sender) + public CountEventArgs(TValue value) { - Sender = sender; + Value = value; } public CountEventArgs() diff --git a/Toolkit.Foundation/Create.cs b/Toolkit.Foundation/Create.cs index 805c72e..25f55c0 100644 --- a/Toolkit.Foundation/Create.cs +++ b/Toolkit.Foundation/Create.cs @@ -2,9 +2,9 @@ public record Create { - public static CreateEventArgs As(TSender sender) => - new(sender); + public static CreateEventArgs As(TValue value) => + new(value); - public static CreateEventArgs As(params object[] parameters) where TSender : new() => - new(new TSender()); + public static CreateEventArgs As() where TValue : new() => + new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/CreateEventArgs.cs b/Toolkit.Foundation/CreateEventArgs.cs index 6535d5e..9fc7626 100644 --- a/Toolkit.Foundation/CreateEventArgs.cs +++ b/Toolkit.Foundation/CreateEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record CreateEventArgs +public record CreateEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public CreateEventArgs(TSender sender) + public CreateEventArgs(TValue value) { - Sender = sender; + Value = value; } public CreateEventArgs() diff --git a/Toolkit.Foundation/Created.cs b/Toolkit.Foundation/Created.cs index 2a96ff6..42bc553 100644 --- a/Toolkit.Foundation/Created.cs +++ b/Toolkit.Foundation/Created.cs @@ -2,9 +2,9 @@ public record Created { - public static CreatedEventArgs As(TSender sender) => - new(sender); + public static CreatedEventArgs As(TValue value) => + new(value); - public static CreatedEventArgs As() where TSender : new() => - new(new TSender()); + public static CreatedEventArgs As() where TValue : new() => + new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/CreatedEventArgs.cs b/Toolkit.Foundation/CreatedEventArgs.cs index e7fa76b..0f72119 100644 --- a/Toolkit.Foundation/CreatedEventArgs.cs +++ b/Toolkit.Foundation/CreatedEventArgs.cs @@ -1,3 +1,3 @@ namespace Toolkit.Foundation; -public record CreatedEventArgs(TSender? Sender = default); \ No newline at end of file +public record CreatedEventArgs(TValue? Value = default); \ No newline at end of file diff --git a/Toolkit.Foundation/Deactivate.cs b/Toolkit.Foundation/Deactivate.cs index 1444801..2b50bcb 100644 --- a/Toolkit.Foundation/Deactivate.cs +++ b/Toolkit.Foundation/Deactivate.cs @@ -2,7 +2,7 @@ public record Deactivate { - public static DeactivateEventArgs As(TSender sender) => new(sender); + public static DeactivateEventArgs As(TValue value) => new(value); - public static DeactivateEventArgs As() where TSender : new() => new(new TSender()); + public static DeactivateEventArgs As() where TValue : new() => new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/DeactivateEventArgs.cs b/Toolkit.Foundation/DeactivateEventArgs.cs index 06cbc25..2982bc0 100644 --- a/Toolkit.Foundation/DeactivateEventArgs.cs +++ b/Toolkit.Foundation/DeactivateEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record DeactivateEventArgs +public record DeactivateEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public DeactivateEventArgs(TSender sender) + public DeactivateEventArgs(TValue value) { - Sender = sender; + Value = value; } public DeactivateEventArgs() diff --git a/Toolkit.Foundation/Deactivated.cs b/Toolkit.Foundation/Deactivated.cs index aeb3e2c..3f975bc 100644 --- a/Toolkit.Foundation/Deactivated.cs +++ b/Toolkit.Foundation/Deactivated.cs @@ -2,7 +2,7 @@ public record Deactivated { - public static DeactivatedEventArgs As(TSender sender) => new(sender); + public static DeactivatedEventArgs As(TValue value) => new(value); - public static DeactivatedEventArgs As() where TSender : new() => new(new TSender()); + public static DeactivatedEventArgs As() where TValue : new() => new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/DeactivatedEventArgs.cs b/Toolkit.Foundation/DeactivatedEventArgs.cs index dca5663..f33f0d9 100644 --- a/Toolkit.Foundation/DeactivatedEventArgs.cs +++ b/Toolkit.Foundation/DeactivatedEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record DeactivatedEventArgs +public record DeactivatedEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public DeactivatedEventArgs(TSender sender) + public DeactivatedEventArgs(TValue value) { - Sender = sender; + Value = value; } public DeactivatedEventArgs() diff --git a/Toolkit.Foundation/Delete.cs b/Toolkit.Foundation/Delete.cs index 5937231..a1a474c 100644 --- a/Toolkit.Foundation/Delete.cs +++ b/Toolkit.Foundation/Delete.cs @@ -2,9 +2,9 @@ public record Delete { - public static DeleteEventArgs As(TSender sender) => - new(sender); + public static DeleteEventArgs As(TValue value) => + new(value); - public static DeleteEventArgs As() where TSender : new() => - new(new TSender()); + public static DeleteEventArgs As() where TValue : new() => + new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/DeleteEventArgs.cs b/Toolkit.Foundation/DeleteEventArgs.cs index e784b11..ab3b0db 100644 --- a/Toolkit.Foundation/DeleteEventArgs.cs +++ b/Toolkit.Foundation/DeleteEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record DeleteEventArgs +public record DeleteEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public DeleteEventArgs(TSender sender) + public DeleteEventArgs(TValue value) { - Sender = sender; + Value = value; } public DeleteEventArgs() diff --git a/Toolkit.Foundation/IServiceCollectionExtensions.cs b/Toolkit.Foundation/IServiceCollectionExtensions.cs index 9a51f6b..a6d6cd7 100644 --- a/Toolkit.Foundation/IServiceCollectionExtensions.cs +++ b/Toolkit.Foundation/IServiceCollectionExtensions.cs @@ -157,6 +157,7 @@ public static class IServiceCollectionExtensions public static IServiceCollection AddInitialization(this IServiceCollection services, Action delegateAction) + { services.AddTransient(provider => new ActionableInitialization(provider, delegateAction)); return services; diff --git a/Toolkit.Foundation/Insert.cs b/Toolkit.Foundation/Insert.cs index e6808aa..a9b29f1 100644 --- a/Toolkit.Foundation/Insert.cs +++ b/Toolkit.Foundation/Insert.cs @@ -2,9 +2,9 @@ public record Insert { - public static InsertEventArgs As(int index, TSender sender) => - new(index, sender); + public static InsertEventArgs As(int index, TValue value) => + new(index, value); - public static InsertEventArgs As(int index) where TSender : new() => - new(index, new TSender()); + public static InsertEventArgs As(int index) where TValue : new() => + new(index, new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/InsertEventArgs.cs b/Toolkit.Foundation/InsertEventArgs.cs index fd89cfc..00cac55 100644 --- a/Toolkit.Foundation/InsertEventArgs.cs +++ b/Toolkit.Foundation/InsertEventArgs.cs @@ -1,3 +1,3 @@ namespace Toolkit.Foundation; -public record InsertEventArgs(int Index, TSender Sender); \ No newline at end of file +public record InsertEventArgs(int Index, TValue Value); \ No newline at end of file diff --git a/Toolkit.Foundation/Move.cs b/Toolkit.Foundation/Move.cs index 482ef13..cfefdbb 100644 --- a/Toolkit.Foundation/Move.cs +++ b/Toolkit.Foundation/Move.cs @@ -2,7 +2,7 @@ public record Move { - public static MoveEventArgs As(int index, TSender sender) => new(index, sender); + public static MoveEventArgs As(int index, TValue value) => new(index, value); - public static MoveEventArgs As(int index) where TSender : new() => new(index, new TSender()); + public static MoveEventArgs As(int index) where TValue : new() => new(index, new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/MoveEventArgs.cs b/Toolkit.Foundation/MoveEventArgs.cs index c8256d2..18df9f2 100644 --- a/Toolkit.Foundation/MoveEventArgs.cs +++ b/Toolkit.Foundation/MoveEventArgs.cs @@ -1,3 +1,3 @@ namespace Toolkit.Foundation; -public record MoveEventArgs(int Index, TSender? Sender = default); \ No newline at end of file +public record MoveEventArgs(int Index, TValue? Value = default); \ No newline at end of file diff --git a/Toolkit.Foundation/MoveToEventArgs.cs b/Toolkit.Foundation/MoveToEventArgs.cs index 845329d..6df3bf5 100644 --- a/Toolkit.Foundation/MoveToEventArgs.cs +++ b/Toolkit.Foundation/MoveToEventArgs.cs @@ -1,18 +1,18 @@ namespace Toolkit.Foundation; -public record MoveToEventArgs +public record MoveToEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } public int OldIndex { get; } public int NewIndex { get; } - public MoveToEventArgs(TSender sender, + public MoveToEventArgs(TValue value, int oldIndex, int newIndex) { - Sender = sender; + Value = value; OldIndex = oldIndex; NewIndex = newIndex; } diff --git a/Toolkit.Foundation/Notify.cs b/Toolkit.Foundation/Notify.cs index 367692c..ce8362a 100644 --- a/Toolkit.Foundation/Notify.cs +++ b/Toolkit.Foundation/Notify.cs @@ -2,7 +2,7 @@ public class Notify { - public static NotifyEventArgs As(TSender sender) => new(sender); + public static NotifyEventArgs As(TValue value) => new(value); - public static NotifyEventArgs As() where TSender : new() => new(new TSender()); + public static NotifyEventArgs As() where TValue : new() => new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/NotifyEventArgs.cs b/Toolkit.Foundation/NotifyEventArgs.cs index 05256ad..4b66d6b 100644 --- a/Toolkit.Foundation/NotifyEventArgs.cs +++ b/Toolkit.Foundation/NotifyEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record NotifyEventArgs +public record NotifyEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public NotifyEventArgs(TSender sender) + public NotifyEventArgs(TValue value) { - Sender = sender; + Value = value; } public NotifyEventArgs() diff --git a/Toolkit.Foundation/ObservableCollection.cs b/Toolkit.Foundation/ObservableCollection.cs index 1e571af..0d46faa 100644 --- a/Toolkit.Foundation/ObservableCollection.cs +++ b/Toolkit.Foundation/ObservableCollection.cs @@ -313,7 +313,7 @@ public abstract partial class ObservableCollection : { foreach (TViewModel item in this.ToList()) { - if (args.Sender is not null && args.Sender.Equals(item)) + if (args.Value is not null && args.Value.Equals(item)) { Remove(item); } @@ -322,7 +322,7 @@ public abstract partial class ObservableCollection : public void Receive(CreateEventArgs args) { - if (args.Sender is TViewModel item) + if (args.Value is TViewModel item) { Add(item); } @@ -330,7 +330,7 @@ public abstract partial class ObservableCollection : public void Receive(InsertEventArgs args) { - if (args.Sender is TViewModel item) + if (args.Value is TViewModel item) { Insert(args.Index, item); } @@ -343,7 +343,7 @@ public abstract partial class ObservableCollection : public void Receive(MoveEventArgs args) { - if (args.Sender is TViewModel item) + if (args.Value is TViewModel item) { Move(args.Index, item); } @@ -351,7 +351,7 @@ public abstract partial class ObservableCollection : public void Receive(ReplaceEventArgs args) { - if (args.Sender is TViewModel item) + if (args.Value is TViewModel item) { Replace(args.Index, item); } diff --git a/Toolkit.Foundation/ObservableConfiguration.cs b/Toolkit.Foundation/ObservableConfiguration.cs index 3eef8c0..547e7f3 100644 --- a/Toolkit.Foundation/ObservableConfiguration.cs +++ b/Toolkit.Foundation/ObservableConfiguration.cs @@ -34,7 +34,7 @@ public partial class ObservableConfiguration : public void Receive(ChangedEventArgs args) { - if (args.Sender is TConfiguration configuration) + if (args.Value is TConfiguration configuration) { dispatcher.Invoke(() => Value = read(configuration)); } diff --git a/Toolkit.Foundation/ObservableConfigurationCollection.cs b/Toolkit.Foundation/ObservableConfigurationCollection.cs index 13512ed..7c188ef 100644 --- a/Toolkit.Foundation/ObservableConfigurationCollection.cs +++ b/Toolkit.Foundation/ObservableConfigurationCollection.cs @@ -57,7 +57,7 @@ public partial class ObservableConfigurationCollection args) { - if (args.Sender is TConfiguration configuration) + if (args.Value is TConfiguration configuration) { dispatcher.Invoke(() => Value = read(configuration)); } diff --git a/Toolkit.Foundation/Open.cs b/Toolkit.Foundation/Open.cs index 16078a6..c9444f5 100644 --- a/Toolkit.Foundation/Open.cs +++ b/Toolkit.Foundation/Open.cs @@ -2,7 +2,7 @@ public record Open { - public static OpenEventArgs As(TSender sender) => new(sender); + public static OpenEventArgs As(TValue value) => new(value); - public static OpenEventArgs As() where TSender : new() => new(new TSender()); + public static OpenEventArgs As() where TValue : new() => new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/OpenEventArgs.cs b/Toolkit.Foundation/OpenEventArgs.cs index 12c92bc..35bddea 100644 --- a/Toolkit.Foundation/OpenEventArgs.cs +++ b/Toolkit.Foundation/OpenEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record OpenEventArgs +public record OpenEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public OpenEventArgs(TSender sender) + public OpenEventArgs(TValue value) { - Sender = sender; + Value = value; } public OpenEventArgs() diff --git a/Toolkit.Foundation/Opened.cs b/Toolkit.Foundation/Opened.cs index f2bc20e..176cdba 100644 --- a/Toolkit.Foundation/Opened.cs +++ b/Toolkit.Foundation/Opened.cs @@ -2,7 +2,7 @@ public record Opened { - public static OpenedEventArgs As(TSender sender) => new(sender); + public static OpenedEventArgs As(TValue value) => new(value); - public static OpenedEventArgs As() where TSender : new() => new(new TSender()); + public static OpenedEventArgs As() where TValue : new() => new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/OpenedEventArgs.cs b/Toolkit.Foundation/OpenedEventArgs.cs index 31579ed..3a2623d 100644 --- a/Toolkit.Foundation/OpenedEventArgs.cs +++ b/Toolkit.Foundation/OpenedEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record OpenedEventArgs +public record OpenedEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public OpenedEventArgs(TSender sender) + public OpenedEventArgs(TValue value) { - Sender = sender; + Value = value; } public OpenedEventArgs() diff --git a/Toolkit.Foundation/QueryEventArgs.cs b/Toolkit.Foundation/QueryEventArgs.cs index f00fe35..0538f6b 100644 --- a/Toolkit.Foundation/QueryEventArgs.cs +++ b/Toolkit.Foundation/QueryEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record QueryEventArgs +public record QueryEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public QueryEventArgs(TSender sender) + public QueryEventArgs(TValue value) { - Sender = sender; + Value = value; } public QueryEventArgs() diff --git a/Toolkit.Foundation/Read.cs b/Toolkit.Foundation/Read.cs index 6449156..e64874b 100644 --- a/Toolkit.Foundation/Read.cs +++ b/Toolkit.Foundation/Read.cs @@ -2,9 +2,9 @@ public class Read { - public static ReadEventArgs As(TSender sender) => - new(sender); + public static ReadEventArgs As(TValue value) => + new(value); - public static ReadEventArgs As() where TSender : new() => - new(new TSender()); + public static ReadEventArgs As() where TValue : new() => + new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/ReadEventArgs.cs b/Toolkit.Foundation/ReadEventArgs.cs index 9145dc2..04cf4ea 100644 --- a/Toolkit.Foundation/ReadEventArgs.cs +++ b/Toolkit.Foundation/ReadEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record ReadEventArgs +public record ReadEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public ReadEventArgs(TSender sender) + public ReadEventArgs(TValue value) { - Sender = sender; + Value = value; } public ReadEventArgs() diff --git a/Toolkit.Foundation/Remove.cs b/Toolkit.Foundation/Remove.cs index 7ce4d60..e65994d 100644 --- a/Toolkit.Foundation/Remove.cs +++ b/Toolkit.Foundation/Remove.cs @@ -2,7 +2,7 @@ public record Remove { - public static RemoveEventArgs As(TSender sender) => new(sender); + public static RemoveEventArgs As(TValue value) => new(value); - public static RemoveEventArgs As() where TSender : new() => new(new TSender()); + public static RemoveEventArgs As() where TValue : new() => new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/RemoveAt.cs b/Toolkit.Foundation/RemoveAt.cs index e675135..77da9e1 100644 --- a/Toolkit.Foundation/RemoveAt.cs +++ b/Toolkit.Foundation/RemoveAt.cs @@ -2,6 +2,6 @@ public record RemoveAt { - public static RemoveAtEventArgs As(int index) => + public static RemoveAtEventArgs As(int index) => new(index); } \ No newline at end of file diff --git a/Toolkit.Foundation/RemoveAtEventArgs.cs b/Toolkit.Foundation/RemoveAtEventArgs.cs index c09f6c7..af60ff0 100644 --- a/Toolkit.Foundation/RemoveAtEventArgs.cs +++ b/Toolkit.Foundation/RemoveAtEventArgs.cs @@ -1,15 +1,15 @@ namespace Toolkit.Foundation; -public record RemoveAtEventArgs +public record RemoveAtEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } public int Index { get; } - public RemoveAtEventArgs(TSender sender, + public RemoveAtEventArgs(TValue value, int index) { - Sender = sender; + Value = value; Index = index; } diff --git a/Toolkit.Foundation/RemoveEventArgs.cs b/Toolkit.Foundation/RemoveEventArgs.cs index 96ebed9..a9ea224 100644 --- a/Toolkit.Foundation/RemoveEventArgs.cs +++ b/Toolkit.Foundation/RemoveEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record RemoveEventArgs +public record RemoveEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public RemoveEventArgs(TSender sender) + public RemoveEventArgs(TValue value) { - Sender = sender; + Value = value; } public RemoveEventArgs() diff --git a/Toolkit.Foundation/Replace.cs b/Toolkit.Foundation/Replace.cs index 1ca83e6..adba807 100644 --- a/Toolkit.Foundation/Replace.cs +++ b/Toolkit.Foundation/Replace.cs @@ -2,7 +2,7 @@ public record Replace { - public static ReplaceEventArgs As(int index, TSender sender) => new(sender, index); + public static ReplaceEventArgs As(int index, TValue value) => new(value, index); - public static ReplaceEventArgs As(int index) where TSender : new() => new(index); + public static ReplaceEventArgs As(int index) where TValue : new() => new(index); } \ No newline at end of file diff --git a/Toolkit.Foundation/ReplaceEventArgs.cs b/Toolkit.Foundation/ReplaceEventArgs.cs index 62e1491..1f57f3d 100644 --- a/Toolkit.Foundation/ReplaceEventArgs.cs +++ b/Toolkit.Foundation/ReplaceEventArgs.cs @@ -1,15 +1,15 @@ namespace Toolkit.Foundation; -public record ReplaceEventArgs +public record ReplaceEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } public int Index { get; } - public ReplaceEventArgs(TSender sender, + public ReplaceEventArgs(TValue value, int index) { - Sender = sender; + Value = value; Index = index; } diff --git a/Toolkit.Foundation/Request.cs b/Toolkit.Foundation/Request.cs index f098aa1..cbf71d6 100644 --- a/Toolkit.Foundation/Request.cs +++ b/Toolkit.Foundation/Request.cs @@ -2,9 +2,9 @@ public class Request { - public static RequestEventArgs As(TSender sender) => - new(sender); + public static RequestEventArgs As(TValue value) => + new(value); - public static RequestEventArgs As() where TSender : new() => - new(new TSender()); + public static RequestEventArgs As() where TValue : new() => + new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/RequestEventArgs.cs b/Toolkit.Foundation/RequestEventArgs.cs index 8a7879a..cd5ac75 100644 --- a/Toolkit.Foundation/RequestEventArgs.cs +++ b/Toolkit.Foundation/RequestEventArgs.cs @@ -2,17 +2,17 @@ public record RequestEventArgs { - public object? Sender { get; init; } + public object? Value { get; init; } - public RequestEventArgs(object? sender = null) + public RequestEventArgs(object? value = null) { - Sender = sender; + Value = value; } } -public record RequestEventArgs : RequestEventArgs +public record RequestEventArgs : RequestEventArgs { - public RequestEventArgs(TSender sender) : base(sender) + public RequestEventArgs(TValue value) : base(value) { } } diff --git a/Toolkit.Foundation/SelectFilesHandler.cs b/Toolkit.Foundation/SelectFilesHandler.cs index dcff4be..5aa1db5 100644 --- a/Toolkit.Foundation/SelectFilesHandler.cs +++ b/Toolkit.Foundation/SelectFilesHandler.cs @@ -6,7 +6,7 @@ public class SelectFilesHandler(IFileProvider fileProvider) : public async Task?> Handle(SelectionEventArgs args, CancellationToken cancellationToken) { - if (args.Sender is FileFilter filter) + if (args.Value is FileFilter filter) { if (await fileProvider.SelectFiles(filter) is { Count: > 0 } files) diff --git a/Toolkit.Foundation/SelectFoldersHandler.cs b/Toolkit.Foundation/SelectFoldersHandler.cs index 7718dd0..ee5ad09 100644 --- a/Toolkit.Foundation/SelectFoldersHandler.cs +++ b/Toolkit.Foundation/SelectFoldersHandler.cs @@ -7,7 +7,7 @@ public class SelectFoldersHandler(IFolderProvider folderProvider) : public async Task?> Handle(SelectionEventArgs args, CancellationToken cancellationToken = default) { - if (args.Sender is FolderFilter filter) + if (args.Value is FolderFilter filter) { if (await folderProvider.SelectFolders(filter) is { Count: > 0 } folders) diff --git a/Toolkit.Foundation/Selection.cs b/Toolkit.Foundation/Selection.cs index aeddbd3..fadeec2 100644 --- a/Toolkit.Foundation/Selection.cs +++ b/Toolkit.Foundation/Selection.cs @@ -2,9 +2,9 @@ public record Selection { - public static SelectionEventArgs As(TSender? sender) => - new(sender); + public static SelectionEventArgs As(TValue? value) => + new(value); - public static SelectionEventArgs As() where TSender : new() => - new(new TSender()); + public static SelectionEventArgs As() where TValue : new() => + new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/SelectionEventArgs.cs b/Toolkit.Foundation/SelectionEventArgs.cs index 8479d19..4941547 100644 --- a/Toolkit.Foundation/SelectionEventArgs.cs +++ b/Toolkit.Foundation/SelectionEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record SelectionEventArgs +public record SelectionEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public SelectionEventArgs(TSender sender) + public SelectionEventArgs(TValue value) { - Sender = sender; + Value = value; } public SelectionEventArgs() diff --git a/Toolkit.Foundation/UpdateEventArgs.cs b/Toolkit.Foundation/UpdateEventArgs.cs index 3b2e201..0cb53f3 100644 --- a/Toolkit.Foundation/UpdateEventArgs.cs +++ b/Toolkit.Foundation/UpdateEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record UpdateEventArgs +public record UpdateEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public UpdateEventArgs(TSender sender) + public UpdateEventArgs(TValue value) { - Sender = sender; + Value = value; } public UpdateEventArgs() diff --git a/Toolkit.Foundation/UpdatedEventArgs.cs b/Toolkit.Foundation/UpdatedEventArgs.cs index db2b1f9..3c2f1a4 100644 --- a/Toolkit.Foundation/UpdatedEventArgs.cs +++ b/Toolkit.Foundation/UpdatedEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record UpdatedEventArgs +public record UpdatedEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public UpdatedEventArgs(TSender sender) + public UpdatedEventArgs(TValue value) { - Sender = sender; + Value = value; } public UpdatedEventArgs() diff --git a/Toolkit.Foundation/Validate.cs b/Toolkit.Foundation/Validate.cs index 90894b1..1a1e9d1 100644 --- a/Toolkit.Foundation/Validate.cs +++ b/Toolkit.Foundation/Validate.cs @@ -2,9 +2,9 @@ public record Validate { - public static ValidateEventArgs As(TSender sender) => - new(sender); + public static ValidateEventArgs As(TValue value) => + new(value); - public static ValidateEventArgs As() where TSender : new() => - new(new TSender()); + public static ValidateEventArgs As() where TValue : new() => + new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/ValidateEventArgs.cs b/Toolkit.Foundation/ValidateEventArgs.cs index f5a01b4..be523ba 100644 --- a/Toolkit.Foundation/ValidateEventArgs.cs +++ b/Toolkit.Foundation/ValidateEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record ValidateEventArgs +public record ValidateEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public ValidateEventArgs(TSender sender) + public ValidateEventArgs(TValue value) { - Sender = sender; + Value = value; } public ValidateEventArgs() diff --git a/Toolkit.Foundation/Write.cs b/Toolkit.Foundation/Write.cs index 479e25b..17bc787 100644 --- a/Toolkit.Foundation/Write.cs +++ b/Toolkit.Foundation/Write.cs @@ -2,9 +2,9 @@ public class Write { - public static WriteEventArgs As(TSender sender) => - new(sender); + public static WriteEventArgs As(TValue value) => + new(value); - public static WriteEventArgs As() where TSender : new() => - new(new TSender()); + public static WriteEventArgs As() where TValue : new() => + new(new TValue()); } \ No newline at end of file diff --git a/Toolkit.Foundation/WriteClipboardHandler.cs b/Toolkit.Foundation/WriteClipboardHandler.cs index a86b170..5fa3997 100644 --- a/Toolkit.Foundation/WriteClipboardHandler.cs +++ b/Toolkit.Foundation/WriteClipboardHandler.cs @@ -6,7 +6,7 @@ public class WriteClipboardHandler(IClipboardWriter clipboardWriter) : public async Task Handle(WriteEventArgs> args, CancellationToken cancellationToken = default) { - if (args.Sender is Clipboard clipboard) + if (args.Value is Clipboard clipboard) { await clipboardWriter.Write(clipboard.Value); } diff --git a/Toolkit.Foundation/WriteEventArgs.cs b/Toolkit.Foundation/WriteEventArgs.cs index 2b9538e..ed0ab2c 100644 --- a/Toolkit.Foundation/WriteEventArgs.cs +++ b/Toolkit.Foundation/WriteEventArgs.cs @@ -1,12 +1,12 @@ namespace Toolkit.Foundation; -public record WriteEventArgs +public record WriteEventArgs { - public TSender? Sender { get; } + public TValue? Value { get; } - public WriteEventArgs(TSender sender) + public WriteEventArgs(TValue value) { - Sender = sender; + Value = value; } public WriteEventArgs()