Src/Black.Beard.ComponentModel/ComponentModel/Accessors/AccessorItem.cs
/// <summary>
/// Gets the specified component type.
/// </summary>
/// <param name="componentType">Type of the component.</param>
/// <param name="withPropertiesEmbeddedInSubType">if set to <c>true</c> [with sub type].</param>
/// <returns></returns>
Gets the specified component type.
Gets the specified component type .
internal static AccessorList Get(Type componentType, bool withPropertiesEmbeddedInSubType = false)
        {
            AccessorList list = null;
            if (_accessors.ContainsKey(componentType))
                list = _accessors[componentType];
            else
            {
                lock (_lock)
                {
                    if (_accessors.ContainsKey(componentType))
                        list = _accessors[componentType];
                    else
                    {
                        list = new AccessorList();
                        foreach (PropertyInfo item in AccessorList.GetProperties(componentType))
                            if (withPropertiesEmbeddedInSubType || item.DeclaringType == componentType && !list.ContainsKey(item.Name))
                                list.Add(new PropertyAccessor(componentType, item));
                        _accessors.Add(componentType, list);
                    }
                }
            }
            return list;
        }
internal static AccessorList Get ( Type componentType , bool withPropertiesEmbeddedInSubType = false ) { AccessorList list = null ; if ( _accessors . ContainsKey ( componentType ) ) list = _accessors [ componentType ] ; else { lock ( _lock ) { if ( _accessors . ContainsKey ( componentType ) ) list = _accessors [ componentType ] ; else { list = new AccessorList ( ) ; foreach ( PropertyInfo item in AccessorList . GetProperties ( componentType ) ) if ( withPropertiesEmbeddedInSubType || item . DeclaringType == componentType && ! list . ContainsKey ( item . Name ) ) list . Add ( new PropertyAccessor ( componentType , item ) ) ; _accessors . Add ( componentType , list ) ; } } } return list ; }
Gets the specified component type.
Gets the specified component type .
None
componentType
Type
Type of the component.
Type of the component .
withPropertiesEmbeddedInSubType
bool
if set to true
if set to true