private bool TryFindHighlightsFrame(FrameCollection frames, out TextFrame highlightFrame) { foreach (TextFrame textFrame in frames?.OfType <TextFrame>() ?? Enumerable.Empty <TextFrame>()) { highlightFrame = textFrame; if (textFrame.FrameId == "TXXX") { return(true); } if (textFrame.Text.StartsWith(highlightsKey)) { return(true); } } highlightFrame = null; return(false); }