var layout = from w in worksheetlayouts
where w.hintlocation.Contains(p) || w.listlocation.Contains(p)
select w;
WorksheetLayout layout = worksheetlayouts
.Where( (value, index) => worksheetlayouts[index].hintlocation.Contains(p) || worksheetlayouts[index].listlocation.Contains(p))
.FirstOrDefault();
if(layout != null){
left = layout.hintlocation.Left;
right = layout[0].hintlocation.Right;
}
</pre>
>