public static string ComposeIcon(this SmartField smartfield, object entity, string value, string field, string format) { if (smartfield == null) throw new ArgumentNullException("smartfield"); var result = (entity != null && !field.IsNullOrEmpty()) ? PropertyHelper.GetValue(entity, field).ToString() : value; if (!format.IsNullOrEmpty()) result = String.Format(format, result); return result; }