private void InitializePropertyDescriptorTypes() { var typeInfos = CandidateTypes .Select(x => x.Value).ToList(); foreach (var item in typeInfos) { var typeProperties = item.GetProperties(); foreach (var propInfo in typeProperties) { var attr = propInfo.GetCustomAttribute <PropertyDescriptorAttribute>(); if (attr != null) { var attribute = attr as PropertyDescriptorAttribute; if (attr.CompossibleItem != CompossibleItemTypes.Unset) { List <PropertyInfo> props = new List <PropertyInfo>(); if (DescriptorProperties.TryGetValue(item, out props)) { props.Add(propInfo); } else { DescriptorProperties.Add(item, new List <PropertyInfo> { propInfo }); } } } } } }
public List <PropertyInfo> GetPropertyDescriptorsOfType(string fullName) { List <PropertyInfo> items = DescriptorProperties.SingleOrDefault(x => x.Key.FullName == fullName).Value; if (items == null) { return(new List <PropertyInfo>()); } return(items); }
public bool HasTypePropertyDescriptor(string fullName) { return(DescriptorProperties.Where(x => x.Key.FullName == fullName).Count() > 0); }