Catel.Data.PropertyDataManager.RegisterProperties C# (CSharp) Метод

RegisterProperties() публичный Метод

Registers all the properties for the specified type. This method can only be called once per type. The PropertyDataManager caches whether it has already registered the properties once.
The is null. The properties are not declared correctly.
public RegisterProperties ( Type type ) : CatelTypeInfo
type System.Type The type to register the properties for.
Результат CatelTypeInfo
        public CatelTypeInfo RegisterProperties(Type type)
        {
            Argument.IsNotNull("type", type);

            lock (_propertyDataLock)
            {
                if (_propertyData.ContainsKey(type))
                {
                    return _propertyData[type];
                }

                var catelTypeInfo = new CatelTypeInfo(type);
                _propertyData[type] = catelTypeInfo;
                return catelTypeInfo;
            }
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Initializes all the properties for this object.
        /// </summary>
        private void InitializeProperties()
        {
            var type = GetType();

            var catelTypeInfo = PropertyDataManager.RegisterProperties(type);

            foreach (var propertyDataKeyValuePair in catelTypeInfo.GetCatelProperties())
            {
                var propertyData = propertyDataKeyValuePair.Value;

                InitializeProperty(propertyData);
            }
        }
All Usage Examples Of Catel.Data.PropertyDataManager::RegisterProperties