Esempio n. 1
0
 /// <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);
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 /// <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;
 }
Esempio n. 4
0
        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;
        }