DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="5.0.0" />

 InvocationList<TDelegate>

public struct InvocationList<TDelegate> : IReadOnlyList<TDelegate>, IEnumerable<TDelegate>, IEnumerable, IReadOnlyCollection<TDelegate> where TDelegate : MulticastDelegate
Represents immutable list of delegates.
public struct Enumerator<TDelegate> where TDelegate : MulticastDelegate

Represents enumerator over the list of delegates.

public static InvocationList<TDelegate> Empty { get; }

Gets an empty list.

public int Count { get; }

Gets the number of delegates in this list.

public bool IsEmpty { get; }

Indicates that this list is empty.

public TDelegate this[int index] { get; }

public ReadOnlySpan<TDelegate> Span { get; }

Gets a span over list of delegates.

public InvocationList(TDelegate d)

Creates a new list containing a single element.

public static InvocationList<TDelegate> op_Addition(InvocationList<TDelegate> list, TDelegate d)

Addes the delegate to the list and returns modified list.

public static InvocationList<TDelegate> op_Subtraction(InvocationList<TDelegate> list, TDelegate d)

Removes the delegate from the list and returns modified list.

public InvocationList<TDelegate> Add(TDelegate d)

Adds a delegate to the list and return a new list.

public TDelegate Combine()

Combines the delegates in the list to a single delegate.

public Enumerator<TDelegate> GetEnumerator()

Gets enumerator over all delegates in this list.

public InvocationList<TDelegate> Remove(TDelegate d)

Removes the delegate from the list.