Пример #1
0
        public object GetPropertyValue(object obj)
        {
            if (_dynamicProperty == null)
            {
                _dynamicProperty = DynamicProperty.Create(this.Property);
            }

            return(_dynamicProperty.GetValue(obj));
        }
Пример #2
0
        public static DynamicProperty Create(PropertyInfo propertyInfo)
        {
            DynamicProperty cached;

            lock (_dynamicPropertyCache)
            {
                if (!_dynamicPropertyCache.TryGetValue(propertyInfo, out cached))
                {
                    cached = new DynamicProperty(propertyInfo);
                    _dynamicPropertyCache.Add(propertyInfo, cached);
                }
            }
            return(cached);
        }