Src/Black.Beard.ComponentModel/ComponentModel/Accessors/PropertyAccessor.cs
/// <summary>
/// Gets the specified component type.
/// </summary>
/// <param name="componentType">Type of the component.</param>
/// <param name="name">The name.</param>
/// <returns></returns>
Gets the specified component type.
Gets the specified component type .
public static PropertyAccessor GetProperty(Type componentType, string name)
        {
            AccessorList list = null;
            PropertyAccessor accessor = null;
            list = Get(componentType, string.IsNullOrEmpty(name));
            if (list.ContainsKey(name))
                accessor = list[name] as PropertyAccessor;
            else
                lock (list._lock)
                {
                    if (list.ContainsKey(name))
                        accessor = list[name] as PropertyAccessor;
                    else
                    {
                        var property = componentType.GetProperty(name);
                        if (property != null)
                            list.Add((accessor = new PropertyAccessor(componentType, property)));
                    }
                }
            return accessor;
        }
public static PropertyAccessor GetProperty ( Type componentType , string name ) { AccessorList list = null ; PropertyAccessor accessor = null ; list = Get ( componentType , string . IsNullOrEmpty ( name ) ) ; if ( list . ContainsKey ( name ) ) accessor = list [ name ] as PropertyAccessor ; else lock ( list . _lock ) { if ( list . ContainsKey ( name ) ) accessor = list [ name ] as PropertyAccessor ; else { var property = componentType . GetProperty ( name ) ; if ( property != null ) list . Add ( ( accessor = new PropertyAccessor ( componentType , property ) ) ) ; } } return accessor ; }
Gets the specified component type.
Gets the specified component type .
None
componentType
Type
Type of the component.
Type of the component .
name
string
None