/// <summary> /// Gets the selected value. /// </summary> /// <param name="personProperty">The person property.</param> /// <returns></returns> public PersonPropertyValue GetSelectedValue(PersonProperty personProperty) { if (personProperty != null) { return(personProperty.Values.Where(v => v.Selected).FirstOrDefault()); } return(null); }
public PersonProperty GetProperty(string key, bool createIfNotFound = false, string label = "") { var property = Properties.Where(p => p.Key.Equals(key, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); if (property == null && createIfNotFound) { if (label == string.Empty) { label = key.SplitCase(); } property = new PersonProperty(key, label); Properties.Add(property); } return(property); }
/// <summary> /// Gets the selected value. /// </summary> /// <param name="personProperty">The person property.</param> /// <returns></returns> public PersonPropertyValue GetSelectedValue( PersonProperty personProperty ) { if ( personProperty != null ) { return personProperty.Values.Where( v => v.Selected ).FirstOrDefault(); } return null; }
public PersonProperty GetProperty( string key, bool createIfNotFound = false, string label = "" ) { var property = Properties.Where( p => p.Key.Equals( key, StringComparison.OrdinalIgnoreCase ) ).FirstOrDefault(); if ( property == null && createIfNotFound ) { if ( label == string.Empty ) { label = key.SplitCase(); } property = new PersonProperty( key, label ); Properties.Add( property ); } return property; }