Example #1
0
        public T FirstOrDefault <T>(Predicate <T> predicate)
            where T : Frame
        {
            object error;

            for (int i = 0; i < count; i++)
            {
                var ptr   = NativeMethods.rs2_extract_frame(Handle, i, out error);
                var frame = Frame.Create <T>(ptr);
                if (predicate(frame))
                {
                    return(frame);
                }

                frame.Dispose();
            }

            return(null);
        }