You can replace the conditional with a Dictionary
lookup to avoid the warning:
private static IDictionary<FlyCapture2Managed.PixelFormat,int> FormatToBpp =
new Dictionary<FlyCapture2Managed.PixelFormat,int> {
{FlyCapture2Managed.PixelFormat.PixelFormatMono8, 8}
, {FlyCapture2Managed.PixelFormat.PixelFormatMono16, 16}
};
...
int bpp;
if (!FormatToBpp.TryGetValue(f7PF, out bpp)) {
MessageBox.Show("Camera misconfigured");
}