/// <summary> /// Gets a filtered collection of <see cref="SegmentModelBase">segments</see> from a given <see cref="SegmentModelCollection"/> /// where the specified frame number is within a segment's <see cref="SegmentModelBase.StartFrame">start</see> and <see cref="SegmentModelBase.EndFrame">end</see> frame range. /// </summary> /// <param name="frameNumber">The frame number to filter by.</param> /// <param name="segmentModelCollection">The <see cref="SegmentModelCollection"/> to filter.</param> /// <returns>An enumerable collection of <see cref="SegmentModelBase">segments</see> where the <see cref="SegmentModelBase.StartFrame">start</see> and <see cref="SegmentModelBase.EndFrame">end</see> frame range contains the <paramref name="frameNumber"/> parameter value.</returns> protected IEnumerable <SegmentModelBase> FilterSegmentModelsByFrameNumber(int frameNumber, SegmentModelCollection segmentModelCollection) { return(segmentModelCollection.Where(segment => segment.IsFrameWithin(frameNumber))); }