protected object ApplyTextFormat(string propertyName, object value) { if (value != null && TextFormats.ContainsKey(propertyName)) { return(string.Format(TextFormats[propertyName], value)); } return(value); }
protected object GetPropertyValue(PropertyInfo property, object item) { #if NET4 var value = property.GetValue(item, null); #endif #if NET45 || NET46 var value = property.GetValue(item); #endif if (value != null && TextFormats.ContainsKey(property.Name)) { return(string.Format(TextFormats[property.Name], value)); } return(value); }