From 8a2497be82b8cc23db70275a58bce6d56533052e Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Wed, 20 Nov 2024 21:25:31 +0000 Subject: [PATCH] Updates --- Toolkit.Foundation/ActivatedEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/CancelEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/ChangedEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/CloseEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/ClosedEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/ConfirmEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/CountEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/CreateEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/DeactivatedEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/DeleteEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/MoveToEventArgs.cs | 25 +++++++++++++++++++++- Toolkit.Foundation/NotifyEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/OpenEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/OpenedEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/Persist.cs | 8 ------- Toolkit.Foundation/PersistEventArgs.cs | 3 --- Toolkit.Foundation/QueryEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/ReadEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/RemoveAtEventArgs.cs | 19 +++++++++++++++- Toolkit.Foundation/RemoveEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/Replace.cs | 4 ++-- Toolkit.Foundation/ReplaceEventArgs.cs | 19 +++++++++++++++- Toolkit.Foundation/RequestEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/SelectionEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/UpdateEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/ValidateEventArgs.cs | 15 ++++++++++++- Toolkit.Foundation/WriteEventArgs.cs | 15 ++++++++++++- 27 files changed, 356 insertions(+), 37 deletions(-) delete mode 100644 Toolkit.Foundation/Persist.cs delete mode 100644 Toolkit.Foundation/PersistEventArgs.cs diff --git a/Toolkit.Foundation/ActivatedEventArgs.cs b/Toolkit.Foundation/ActivatedEventArgs.cs index 99fcacf..c6f0c39 100644 --- a/Toolkit.Foundation/ActivatedEventArgs.cs +++ b/Toolkit.Foundation/ActivatedEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record ActivatedEventArgs(TSender? Sender = default); \ No newline at end of file +public record ActivatedEventArgs +{ + public TSender? Sender { get; } + + public ActivatedEventArgs(TSender sender) + { + Sender = sender; + } + + public ActivatedEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/CancelEventArgs.cs b/Toolkit.Foundation/CancelEventArgs.cs index 3f706f0..7c0ef87 100644 --- a/Toolkit.Foundation/CancelEventArgs.cs +++ b/Toolkit.Foundation/CancelEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record CancelEventArgs(TSender Sender); \ No newline at end of file +public record CancelEventArgs +{ + public TSender? Sender { get; } + + public CancelEventArgs(TSender sender) + { + Sender = sender; + } + + public CancelEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/ChangedEventArgs.cs b/Toolkit.Foundation/ChangedEventArgs.cs index 5e6c1c7..f64ec9d 100644 --- a/Toolkit.Foundation/ChangedEventArgs.cs +++ b/Toolkit.Foundation/ChangedEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record ChangedEventArgs(TSender? Sender = default); \ No newline at end of file +public record ChangedEventArgs +{ + public TSender? Sender { get; } + + public ChangedEventArgs(TSender sender) + { + Sender = sender; + } + + public ChangedEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/CloseEventArgs.cs b/Toolkit.Foundation/CloseEventArgs.cs index 1740d41..669ca78 100644 --- a/Toolkit.Foundation/CloseEventArgs.cs +++ b/Toolkit.Foundation/CloseEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record CloseEventArgs(TSender? Sender = default); +public record CloseEventArgs +{ + public TSender? Sender { get; } + + public CloseEventArgs(TSender sender) + { + Sender = sender; + } + + public CloseEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/ClosedEventArgs.cs b/Toolkit.Foundation/ClosedEventArgs.cs index 0b0cae6..989be8c 100644 --- a/Toolkit.Foundation/ClosedEventArgs.cs +++ b/Toolkit.Foundation/ClosedEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record ClosedEventArgs(TSender? Sender = default); +public record ClosedEventArgs +{ + public TSender? Sender { get; } + + public ClosedEventArgs(TSender sender) + { + Sender = sender; + } + + public ClosedEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/ConfirmEventArgs.cs b/Toolkit.Foundation/ConfirmEventArgs.cs index 16d4dc2..129e177 100644 --- a/Toolkit.Foundation/ConfirmEventArgs.cs +++ b/Toolkit.Foundation/ConfirmEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record ConfirmEventArgs(TValue Value); \ No newline at end of file +public record ConfirmEventArgs +{ + public TSender? Sender { get; } + + public ConfirmEventArgs(TSender sender) + { + Sender = sender; + } + + public ConfirmEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/CountEventArgs.cs b/Toolkit.Foundation/CountEventArgs.cs index b222c5f..0e25519 100644 --- a/Toolkit.Foundation/CountEventArgs.cs +++ b/Toolkit.Foundation/CountEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record CountEventArgs(TSender Sender); \ No newline at end of file +public record CountEventArgs +{ + public TSender? Sender { get; } + + public CountEventArgs(TSender sender) + { + Sender = sender; + } + + public CountEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/CreateEventArgs.cs b/Toolkit.Foundation/CreateEventArgs.cs index 3550caf..6535d5e 100644 --- a/Toolkit.Foundation/CreateEventArgs.cs +++ b/Toolkit.Foundation/CreateEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record CreateEventArgs(TSender? Sender = default); \ No newline at end of file +public record CreateEventArgs +{ + public TSender? Sender { get; } + + public CreateEventArgs(TSender sender) + { + Sender = sender; + } + + public CreateEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/DeactivatedEventArgs.cs b/Toolkit.Foundation/DeactivatedEventArgs.cs index 2efcbd9..1798aa2 100644 --- a/Toolkit.Foundation/DeactivatedEventArgs.cs +++ b/Toolkit.Foundation/DeactivatedEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record DeactivatedEventArgs(TSender? Sender = default); \ No newline at end of file +public record DeactivatedEventArgs +{ + public TSender? Sender { get; } + + public DeactivatedEventArgs(TSender sender) + { + Sender = sender; + } + + public DeactivatedEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/DeleteEventArgs.cs b/Toolkit.Foundation/DeleteEventArgs.cs index 00cce35..e784b11 100644 --- a/Toolkit.Foundation/DeleteEventArgs.cs +++ b/Toolkit.Foundation/DeleteEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record DeleteEventArgs(TSender? Sender = default); \ No newline at end of file +public record DeleteEventArgs +{ + public TSender? Sender { get; } + + public DeleteEventArgs(TSender sender) + { + Sender = sender; + } + + public DeleteEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/MoveToEventArgs.cs b/Toolkit.Foundation/MoveToEventArgs.cs index fc5c41c..845329d 100644 --- a/Toolkit.Foundation/MoveToEventArgs.cs +++ b/Toolkit.Foundation/MoveToEventArgs.cs @@ -1,3 +1,26 @@ namespace Toolkit.Foundation; -public record MoveToEventArgs(int OldIndex, int NewIndex); \ No newline at end of file +public record MoveToEventArgs +{ + public TSender? Sender { get; } + + public int OldIndex { get; } + + public int NewIndex { get; } + + public MoveToEventArgs(TSender sender, + int oldIndex, + int newIndex) + { + Sender = sender; + OldIndex = oldIndex; + NewIndex = newIndex; + } + + public MoveToEventArgs(int oldIndex, + int newIndex) + { + OldIndex = oldIndex; + NewIndex = newIndex; + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/NotifyEventArgs.cs b/Toolkit.Foundation/NotifyEventArgs.cs index 6803ca5..05256ad 100644 --- a/Toolkit.Foundation/NotifyEventArgs.cs +++ b/Toolkit.Foundation/NotifyEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record NotifyEventArgs(TSender? Sender = default); \ No newline at end of file +public record NotifyEventArgs +{ + public TSender? Sender { get; } + + public NotifyEventArgs(TSender sender) + { + Sender = sender; + } + + public NotifyEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/OpenEventArgs.cs b/Toolkit.Foundation/OpenEventArgs.cs index 74a0bce..12c92bc 100644 --- a/Toolkit.Foundation/OpenEventArgs.cs +++ b/Toolkit.Foundation/OpenEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record OpenEventArgs(TSender? Sender = default); \ No newline at end of file +public record OpenEventArgs +{ + public TSender? Sender { get; } + + public OpenEventArgs(TSender sender) + { + Sender = sender; + } + + public OpenEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/OpenedEventArgs.cs b/Toolkit.Foundation/OpenedEventArgs.cs index ccb429b..31579ed 100644 --- a/Toolkit.Foundation/OpenedEventArgs.cs +++ b/Toolkit.Foundation/OpenedEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record OpenedEventArgs(TSender? Sender = default); \ No newline at end of file +public record OpenedEventArgs +{ + public TSender? Sender { get; } + + public OpenedEventArgs(TSender sender) + { + Sender = sender; + } + + public OpenedEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/Persist.cs b/Toolkit.Foundation/Persist.cs deleted file mode 100644 index 2f8a75f..0000000 --- a/Toolkit.Foundation/Persist.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Toolkit.Foundation; - -public class Persist -{ - public static PersistEventArgs As(TSender sender) => new(sender); - - public static PersistEventArgs As() where TSender : new() => new(new TSender()); -} \ No newline at end of file diff --git a/Toolkit.Foundation/PersistEventArgs.cs b/Toolkit.Foundation/PersistEventArgs.cs deleted file mode 100644 index 8322b23..0000000 --- a/Toolkit.Foundation/PersistEventArgs.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace Toolkit.Foundation; - -public record PersistEventArgs(TSender? Sender = default); \ No newline at end of file diff --git a/Toolkit.Foundation/QueryEventArgs.cs b/Toolkit.Foundation/QueryEventArgs.cs index feea16c..f00fe35 100644 --- a/Toolkit.Foundation/QueryEventArgs.cs +++ b/Toolkit.Foundation/QueryEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record QueryEventArgs(TSender Sender); \ No newline at end of file +public record QueryEventArgs +{ + public TSender? Sender { get; } + + public QueryEventArgs(TSender sender) + { + Sender = sender; + } + + public QueryEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/ReadEventArgs.cs b/Toolkit.Foundation/ReadEventArgs.cs index 4172b67..9145dc2 100644 --- a/Toolkit.Foundation/ReadEventArgs.cs +++ b/Toolkit.Foundation/ReadEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record ReadEventArgs(TSender? Sender = default); \ No newline at end of file +public record ReadEventArgs +{ + public TSender? Sender { get; } + + public ReadEventArgs(TSender sender) + { + Sender = sender; + } + + public ReadEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/RemoveAtEventArgs.cs b/Toolkit.Foundation/RemoveAtEventArgs.cs index 1a45527..c09f6c7 100644 --- a/Toolkit.Foundation/RemoveAtEventArgs.cs +++ b/Toolkit.Foundation/RemoveAtEventArgs.cs @@ -1,3 +1,20 @@ namespace Toolkit.Foundation; -public record RemoveAtEventArgs(int Index); \ No newline at end of file +public record RemoveAtEventArgs +{ + public TSender? Sender { get; } + + public int Index { get; } + + public RemoveAtEventArgs(TSender sender, + int index) + { + Sender = sender; + Index = index; + } + + public RemoveAtEventArgs(int index) + { + Index = index; + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/RemoveEventArgs.cs b/Toolkit.Foundation/RemoveEventArgs.cs index 5ba67ac..96ebed9 100644 --- a/Toolkit.Foundation/RemoveEventArgs.cs +++ b/Toolkit.Foundation/RemoveEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record RemoveEventArgs(TSender? Sender = default); \ No newline at end of file +public record RemoveEventArgs +{ + public TSender? Sender { get; } + + public RemoveEventArgs(TSender sender) + { + Sender = sender; + } + + public RemoveEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/Replace.cs b/Toolkit.Foundation/Replace.cs index 92372e7..1ca83e6 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(index, sender); + public static ReplaceEventArgs As(int index, TSender sender) => new(sender, index); - public static ReplaceEventArgs As(int index) where TSender : new() => new(index, new TSender()); + public static ReplaceEventArgs As(int index) where TSender : new() => new(index); } \ No newline at end of file diff --git a/Toolkit.Foundation/ReplaceEventArgs.cs b/Toolkit.Foundation/ReplaceEventArgs.cs index 91698f4..62e1491 100644 --- a/Toolkit.Foundation/ReplaceEventArgs.cs +++ b/Toolkit.Foundation/ReplaceEventArgs.cs @@ -1,3 +1,20 @@ namespace Toolkit.Foundation; -public record ReplaceEventArgs(int Index, TSender? Sender = default); \ No newline at end of file +public record ReplaceEventArgs +{ + public TSender? Sender { get; } + + public int Index { get; } + + public ReplaceEventArgs(TSender sender, + int index) + { + Sender = sender; + Index = index; + } + + public ReplaceEventArgs(int index) + { + Index = index; + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/RequestEventArgs.cs b/Toolkit.Foundation/RequestEventArgs.cs index 6cb1cf9..0165c22 100644 --- a/Toolkit.Foundation/RequestEventArgs.cs +++ b/Toolkit.Foundation/RequestEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record RequestEventArgs(TSender? Sender = default); \ No newline at end of file +public record RequestEventArgs +{ + public TSender? Sender { get; } + + public RequestEventArgs(TSender sender) + { + Sender = sender; + } + + public RequestEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/SelectionEventArgs.cs b/Toolkit.Foundation/SelectionEventArgs.cs index 48def9c..8479d19 100644 --- a/Toolkit.Foundation/SelectionEventArgs.cs +++ b/Toolkit.Foundation/SelectionEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record SelectionEventArgs(TSender? Sender); \ No newline at end of file +public record SelectionEventArgs +{ + public TSender? Sender { get; } + + public SelectionEventArgs(TSender sender) + { + Sender = sender; + } + + public SelectionEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/UpdateEventArgs.cs b/Toolkit.Foundation/UpdateEventArgs.cs index 6e3826c..4f8f247 100644 --- a/Toolkit.Foundation/UpdateEventArgs.cs +++ b/Toolkit.Foundation/UpdateEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record UpdateEventArgs(TSender Sender); \ No newline at end of file +public record UpdateEventArgs +{ + public TSender? Sender { get; } + + public UpdateEventArgs(TSender sender) + { + Sender = sender; + } + + public UpdateEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/ValidateEventArgs.cs b/Toolkit.Foundation/ValidateEventArgs.cs index 409a873..f5a01b4 100644 --- a/Toolkit.Foundation/ValidateEventArgs.cs +++ b/Toolkit.Foundation/ValidateEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record ValidateEventArgs(TSender? Sender = default); \ No newline at end of file +public record ValidateEventArgs +{ + public TSender? Sender { get; } + + public ValidateEventArgs(TSender sender) + { + Sender = sender; + } + + public ValidateEventArgs() + { + + } +} \ No newline at end of file diff --git a/Toolkit.Foundation/WriteEventArgs.cs b/Toolkit.Foundation/WriteEventArgs.cs index f6ad727..2b9538e 100644 --- a/Toolkit.Foundation/WriteEventArgs.cs +++ b/Toolkit.Foundation/WriteEventArgs.cs @@ -1,3 +1,16 @@ namespace Toolkit.Foundation; -public record WriteEventArgs(TSender? Sender = default); \ No newline at end of file +public record WriteEventArgs +{ + public TSender? Sender { get; } + + public WriteEventArgs(TSender sender) + { + Sender = sender; + } + + public WriteEventArgs() + { + + } +} \ No newline at end of file