InvocationList
Provides various extensions for InvocationList<T> type.
using System;
using System.Runtime.CompilerServices;
namespace DotNext.Collections.Specialized
{
[NullableContext(1)]
[Nullable(0)]
public static class InvocationList
{
public static void Invoke<[Nullable(2)] T>([Nullable(new byte[] {
0,
1,
1
})] this InvocationList<Action<T>> actions, T arg)
{
ReadOnlySpan<Action<T>> span = actions.Span;
for (int i = 0; i < span.Length; i++) {
span[i](arg);
}
}
public static void Invoke<[Nullable(2)] T1, [Nullable(2)] T2>([Nullable(new byte[] {
0,
1,
1,
1
})] this InvocationList<Action<T1, T2>> actions, T1 arg1, T2 arg2)
{
ReadOnlySpan<Action<T1, T2>> span = actions.Span;
for (int i = 0; i < span.Length; i++) {
span[i](arg1, arg2);
}
}
}
}