public static Inline GetMainTextFromContents(InlineCollection contents) { var contentDictionary = contents.ToDictionary(p => p.Name); return !contentDictionary.ContainsKey("MainText") ? null : contentDictionary["MainText"]; }