private void InitializeProperties(object first) { Type type = first.GetType(); if (ComponentParams.Contains("columns") == false) { if (propertiesCache.Contains(type)) { properties = (PropertyInfo[])propertiesCache[type]; } else { propertiesCache[type] = properties = type.GetProperties(); } return; } List <PropertyInfo> props = new List <PropertyInfo>(); IEnumerable columns = (IEnumerable)ComponentParams["columns"]; foreach (string columnName in columns) { string key = type.FullName + "." + columnName; PropertyInfo propertyInfo; if (propertiesCache.Contains(key)) { propertyInfo = (PropertyInfo)propertiesCache[key]; } else { propertiesCache[key] = propertyInfo = type.GetProperty(columnName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase); } if (propertyInfo != null) { props.Add(propertyInfo); } } properties = props.ToArray(); }