/// <summary> /// Null-safe method for testing if the first video track meets certain criteria. /// </summary> /// <param name="delegate">Does NOT need to check if the video track is null. It will not be invoked if there are no video tracks.</param> /// <returns>The delegate's return value if this playlist has a video track; otherwise false.</returns> bool TestFirstVideoTrack(FirstVideoTrackDelegate @delegate) { var video = VideoTracks.FirstOrDefault(); return video != null && @delegate(video); }
/// <summary> /// Null-safe method for testing if the first video track meets certain criteria. /// </summary> /// <param name="delegate">Does NOT need to check if the video track is null. It will not be invoked if there are no video tracks.</param> /// <returns>The delegate's return value if this playlist has a video track; otherwise false.</returns> bool TestFirstVideoTrack(FirstVideoTrackDelegate @delegate) { var video = VideoTracks.FirstOrDefault(); return(video != null && @delegate(video)); }