コード例 #1
0
        private Dictionary <string, PropertyStoreItem> CreatePropertyStoreItems()
        {
            var dictionary = new Dictionary <string, PropertyStoreItem>();
            var enumerable = _type.GetRuntimeProperties().Where(prop => prop.IsPublic() && !prop.GetIndexParameters().Any());

            foreach (var item in enumerable)
            {
                var value = new PropertyStoreItem(item.PropertyType, CustomAttributeExtensions.GetCustomAttributes(item, inherit: true));
                dictionary[item.Name] = value;
            }
            return(dictionary);
        }
コード例 #2
0
 internal bool TryGetPropertyStoreItem(string propertyName, out PropertyStoreItem item)
 {
     if (_propertyStoreItems == null)
     {
         lock (_syncRoot)
         {
             if (_propertyStoreItems == null)
             {
                 _propertyStoreItems = CreatePropertyStoreItems();
             }
         }
     }
     return(_propertyStoreItems.TryGetValue(propertyName, out item));
 }