public ControlMetadata FindFieldWithPrefix(string prefixToLookFor) { ControlMetadata cm = null; if (LeftControls != null) { cm = LeftControls.Find( x => x.DataSourceExpression != null && x.DataSourceExpression.StartsWith(prefixToLookFor)); if (cm != null) { return(cm); } } if (RightControls != null) { cm = RightControls.Find( x => x.DataSourceExpression != null && x.DataSourceExpression.StartsWith(prefixToLookFor)); if (cm != null) { return(cm); } } return(null); }
public bool ContainsField(string fieldName) { if (LeftControls != null && LeftControls.Exists( f1 => string.Equals(f1.DataSourceExpression, fieldName, StringComparison.CurrentCultureIgnoreCase))) { return(true); } if (RightControls != null && RightControls.Exists( f1 => string.Equals(f1.DataSourceExpression, fieldName, StringComparison.CurrentCultureIgnoreCase))) { return(true); } return(false); }