I would recommend checking the documentation sources below.
Inline profile functions
Inline stream functions
The Resolve() instruction at the very bottom of this page looks promising in terms of filtering profiles, as it resolve the configuration filters to find a matching device and streams profiles.
Currently the way to create a stream profile goes like this
streamProfile = depthSensor.VideoStreamProfiles
.Where(p => p.Stream == Stream.Depth)
.OrderByDescending(p => p.Framerate)
.Where(p => p.Width == width && p.Height == height)
I rather just Create a new stream profile and use it on the fly.
Instead of choosing based upon linq statements.
I assume their just some object properties to be set.