Skip to content

Commit ac6c8a1

Browse files
committed
Changed async trigger helpers to be private
1 parent d966bcb commit ac6c8a1

14 files changed

Lines changed: 106 additions & 125 deletions

src/bunit.web/EventDispatchExtensions/ClipboardEventDispatchExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static class ClipboardEventDispatchExtensions
2323
/// </summary>
2424
/// <param name="element">The element to raise the event on.</param>
2525
/// <returns>A task that completes when the event handler is done.</returns>
26-
public static Task BeforeCopyAsync(this IElement element) => element.TriggerEventAsync("onbeforecopy", EventArgs.Empty);
26+
private static Task BeforeCopyAsync(this IElement element) => element.TriggerEventAsync("onbeforecopy", EventArgs.Empty);
2727

2828
/// <summary>
2929
/// Raises the <c>@onbeforecut</c> event on <paramref name="element"/>, passing an empty (<see cref="EventArgs.Empty"/>)
@@ -38,7 +38,7 @@ public static class ClipboardEventDispatchExtensions
3838
/// </summary>
3939
/// <param name="element">The element to raise the event on.</param>
4040
/// <returns>A task that completes when the event handler is done.</returns>
41-
public static Task BeforeCutAsync(this IElement element) => element.TriggerEventAsync("onbeforecut", EventArgs.Empty);
41+
private static Task BeforeCutAsync(this IElement element) => element.TriggerEventAsync("onbeforecut", EventArgs.Empty);
4242

4343
/// <summary>
4444
/// Raises the <c>@onbeforepaste</c> event on <paramref name="element"/>, passing an empty (<see cref="EventArgs.Empty"/>)
@@ -53,7 +53,7 @@ public static class ClipboardEventDispatchExtensions
5353
/// </summary>
5454
/// <param name="element">The element to raise the event on.</param>
5555
/// <returns>A task that completes when the event handler is done.</returns>
56-
public static Task BeforePasteAsync(this IElement element) => element.TriggerEventAsync("onbeforepaste", EventArgs.Empty);
56+
private static Task BeforePasteAsync(this IElement element) => element.TriggerEventAsync("onbeforepaste", EventArgs.Empty);
5757

5858
/// <summary>
5959
/// Raises the <c>@oncopy</c> event on <paramref name="element"/>, passing the provided
@@ -78,7 +78,7 @@ public static class ClipboardEventDispatchExtensions
7878
/// <param name="element"></param>
7979
/// <param name="eventArgs"></param>
8080
/// <returns>A task that completes when the event handler is done.</returns>
81-
public static Task CopyAsync(this IElement element, ClipboardEventArgs eventArgs) => element.TriggerEventAsync("oncopy", eventArgs);
81+
private static Task CopyAsync(this IElement element, ClipboardEventArgs eventArgs) => element.TriggerEventAsync("oncopy", eventArgs);
8282

8383
/// <summary>
8484
/// Raises the <c>@oncut</c> event on <paramref name="element"/>, passing the provided
@@ -103,7 +103,7 @@ public static class ClipboardEventDispatchExtensions
103103
/// <param name="element"></param>
104104
/// <param name="eventArgs"></param>
105105
/// <returns>A task that completes when the event handler is done.</returns>
106-
public static Task CutAsync(this IElement element, ClipboardEventArgs eventArgs) => element.TriggerEventAsync("oncut", eventArgs);
106+
private static Task CutAsync(this IElement element, ClipboardEventArgs eventArgs) => element.TriggerEventAsync("oncut", eventArgs);
107107

108108
/// <summary>
109109
/// Raises the <c>@onpaste</c> event on <paramref name="element"/>, passing the provided
@@ -128,6 +128,6 @@ public static class ClipboardEventDispatchExtensions
128128
/// <param name="element"></param>
129129
/// <param name="eventArgs"></param>
130130
/// <returns>A task that completes when the event handler is done.</returns>
131-
public static Task PasteAsync(this IElement element, ClipboardEventArgs eventArgs) => element.TriggerEventAsync("onpaste", eventArgs);
131+
private static Task PasteAsync(this IElement element, ClipboardEventArgs eventArgs) => element.TriggerEventAsync("onpaste", eventArgs);
132132
}
133133
}

src/bunit.web/EventDispatchExtensions/DragEventDispatchExtensions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static void Drag(this IElement element, long detail = default, double scr
5656
/// <param name="element"></param>
5757
/// <param name="eventArgs"></param>
5858
/// <returns>A task that completes when the event handler is done.</returns>
59-
public static Task DragAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondrag", eventArgs);
59+
private static Task DragAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondrag", eventArgs);
6060

6161
/// <summary>
6262
/// Raises the <c>@ondragend</c> event on <paramref name="element"/>, passing the provided
@@ -105,7 +105,7 @@ public static void DragEnd(this IElement element, long detail = default, double
105105
/// <param name="element"></param>
106106
/// <param name="eventArgs"></param>
107107
/// <returns>A task that completes when the event handler is done.</returns>
108-
public static Task DragEndAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondragend", eventArgs);
108+
private static Task DragEndAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondragend", eventArgs);
109109

110110
/// <summary>
111111
/// Raises the <c>@ondragenter</c> event on <paramref name="element"/>, passing the provided
@@ -154,7 +154,7 @@ public static void DragEnter(this IElement element, long detail = default, doubl
154154
/// <param name="element"></param>
155155
/// <param name="eventArgs"></param>
156156
/// <returns>A task that completes when the event handler is done.</returns>
157-
public static Task DragEnterAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondragenter", eventArgs);
157+
private static Task DragEnterAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondragenter", eventArgs);
158158

159159
/// <summary>
160160
/// Raises the <c>@ondragleave</c> event on <paramref name="element"/>, passing the provided
@@ -203,7 +203,7 @@ public static void DragLeave(this IElement element, long detail = default, doubl
203203
/// <param name="element"></param>
204204
/// <param name="eventArgs"></param>
205205
/// <returns>A task that completes when the event handler is done.</returns>
206-
public static Task DragLeaveAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondragleave", eventArgs);
206+
private static Task DragLeaveAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondragleave", eventArgs);
207207

208208
/// <summary>
209209
/// Raises the <c>@ondragover</c> event on <paramref name="element"/>, passing the provided
@@ -252,7 +252,7 @@ public static void DragOver(this IElement element, long detail = default, double
252252
/// <param name="element"></param>
253253
/// <param name="eventArgs"></param>
254254
/// <returns>A task that completes when the event handler is done.</returns>
255-
public static Task DragOverAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondragover", eventArgs);
255+
private static Task DragOverAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondragover", eventArgs);
256256

257257
/// <summary>
258258
/// Raises the <c>@ondragstart</c> event on <paramref name="element"/>, passing the provided
@@ -301,7 +301,7 @@ public static void DragStart(this IElement element, long detail = default, doubl
301301
/// <param name="element"></param>
302302
/// <param name="eventArgs"></param>
303303
/// <returns>A task that completes when the event handler is done.</returns>
304-
public static Task DragStartAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondragstart", eventArgs);
304+
private static Task DragStartAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondragstart", eventArgs);
305305

306306
/// <summary>
307307
/// Raises the <c>@ondrop</c> event on <paramref name="element"/>, passing the provided
@@ -350,6 +350,6 @@ public static void Drop(this IElement element, long detail = default, double scr
350350
/// <param name="element"></param>
351351
/// <param name="eventArgs"></param>
352352
/// <returns>A task that completes when the event handler is done.</returns>
353-
public static Task DropAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondrop", eventArgs);
353+
private static Task DropAsync(this IElement element, DragEventArgs eventArgs) => element.TriggerEventAsync("ondrop", eventArgs);
354354
}
355355
}

src/bunit.web/EventDispatchExtensions/FocusEventDispatchExtensions.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ public static class FocusEventDispatchExtensions
2222
/// event arguments to the event handler.
2323
/// </summary>
2424
/// <param name="element">The element to raise the event on.</param>
25-
/// <param name="eventArgs">The event arguments to passs the event handler.</param>
25+
/// <param name="eventArgs">The event arguments to pass the event handler.</param>
2626
public static void Focus(this IElement element, FocusEventArgs eventArgs) => _ = FocusAsync(element, eventArgs);
2727

2828
/// <summary>
2929
/// Raises the <c>@onfocus</c> event on <paramref name="element"/>, passing the provided
3030
/// event arguments to the event handler.
3131
/// </summary>
3232
/// <param name="element">The element to raise the event on.</param>
33-
/// <param name="eventArgs">The event arguments to passs the event handler.</param>
33+
/// <param name="eventArgs">The event arguments to pass the event handler.</param>
3434
/// <returns>A task that completes when the event handler is done.</returns>
35-
public static Task FocusAsync(this IElement element, FocusEventArgs eventArgs) => element.TriggerEventAsync("onfocus", eventArgs);
35+
private static Task FocusAsync(this IElement element, FocusEventArgs eventArgs) => element.TriggerEventAsync("onfocus", eventArgs);
3636

3737
/// <summary>
3838
/// Raises the <c>@onblur</c> event on <paramref name="element"/>, passing the provided
@@ -47,17 +47,17 @@ public static class FocusEventDispatchExtensions
4747
/// event arguments to the event handler.
4848
/// </summary>
4949
/// <param name="element">The element to raise the event on.</param>
50-
/// <param name="eventArgs">The event arguments to passs the event handler.</param>
50+
/// <param name="eventArgs">The event arguments to pass the event handler.</param>
5151
public static void Blur(this IElement element, FocusEventArgs eventArgs) => _ = BlurAsync(element, eventArgs);
5252

5353
/// <summary>
5454
/// Raises the <c>@onblur</c> event on <paramref name="element"/>, passing the provided
5555
/// event arguments to the event handler.
5656
/// </summary>
5757
/// <param name="element">The element to raise the event on.</param>
58-
/// <param name="eventArgs">The event arguments to passs the event handler.</param>
58+
/// <param name="eventArgs">The event arguments to pass the event handler.</param>
5959
/// <returns>A task that completes when the event handler is done.</returns>
60-
public static Task BlurAsync(this IElement element, FocusEventArgs eventArgs) => element.TriggerEventAsync("onblur", eventArgs);
60+
private static Task BlurAsync(this IElement element, FocusEventArgs eventArgs) => element.TriggerEventAsync("onblur", eventArgs);
6161

6262
/// <summary>
6363
/// Raises the <c>@onfocusin</c> event on <paramref name="element"/>, passing the provided
@@ -72,17 +72,17 @@ public static class FocusEventDispatchExtensions
7272
/// event arguments to the event handler.
7373
/// </summary>
7474
/// <param name="element">The element to raise the event on.</param>
75-
/// <param name="eventArgs">The event arguments to passs the event handler.</param>
75+
/// <param name="eventArgs">The event arguments to pass the event handler.</param>
7676
public static void FocusIn(this IElement element, FocusEventArgs eventArgs) => _ = FocusInAsync(element, eventArgs);
7777

7878
/// <summary>
7979
/// Raises the <c>@onfocusin</c> event on <paramref name="element"/>, passing the provided
8080
/// event arguments to the event handler.
8181
/// </summary>
8282
/// <param name="element">The element to raise the event on.</param>
83-
/// <param name="eventArgs">The event arguments to passs the event handler.</param>
83+
/// <param name="eventArgs">The event arguments to pass the event handler.</param>
8484
/// <returns>A task that completes when the event handler is done.</returns>
85-
public static Task FocusInAsync(this IElement element, FocusEventArgs eventArgs) => element.TriggerEventAsync("onfocusin", eventArgs);
85+
private static Task FocusInAsync(this IElement element, FocusEventArgs eventArgs) => element.TriggerEventAsync("onfocusin", eventArgs);
8686

8787
/// <summary>
8888
/// Raises the <c>@onfocusout</c> event on <paramref name="element"/>, passing the provided
@@ -97,16 +97,16 @@ public static class FocusEventDispatchExtensions
9797
/// event arguments to the event handler.
9898
/// </summary>
9999
/// <param name="element">The element to raise the event on.</param>
100-
/// <param name="eventArgs">The event arguments to passs the event handler.</param>
100+
/// <param name="eventArgs">The event arguments to pass the event handler.</param>
101101
public static void FocusOut(this IElement element, FocusEventArgs eventArgs) => _ = FocusOutAsync(element, eventArgs);
102102

103103
/// <summary>
104104
/// Raises the <c>@onfocusout</c> event on <paramref name="element"/>, passing the provided
105105
/// event arguments to the event handler.
106106
/// </summary>
107107
/// <param name="element">The element to raise the event on.</param>
108-
/// <param name="eventArgs">The event arguments to passs the event handler.</param>
108+
/// <param name="eventArgs">The event arguments to pass the event handler.</param>
109109
/// <returns>A task that completes when the event handler is done.</returns>
110-
public static Task FocusOutAsync(this IElement element, FocusEventArgs eventArgs) => element.TriggerEventAsync("onfocusout", eventArgs);
110+
private static Task FocusOutAsync(this IElement element, FocusEventArgs eventArgs) => element.TriggerEventAsync("onfocusout", eventArgs);
111111
}
112112
}

0 commit comments

Comments
 (0)