public static void WaitAll(params Event[] events) { if (events == null) { throw new ArgumentNullException(nameof(events)); } if (events.Length == 0) { throw new ArgumentException($"{nameof(events)} cannot be empty", nameof(events)); } EventSafeHandle[] eventHandles = null; if (events != null) { eventHandles = Array.ConvertAll(events, @event => @event.Handle); } UnsafeNativeMethods.WaitForEvents(eventHandles); }