string TruncateValue(XPMemberInfo xpMemberInfo, string value) { if (xpMemberInfo.HasAttribute(typeof(SizeAttribute))) { int size = ((SizeAttribute)xpMemberInfo.GetAttributeInfo(typeof(SizeAttribute))).Size; if (size > -1 && value.Length > size) { value = value.Substring(0, size - 1); } } else if (value.Length > 99) { value = value.Substring(0, 99); } return(value); }
string TruncateValue(XPMemberInfo xpMemberInfo, string value) { if (xpMemberInfo.HasAttribute(typeof(SizeAttribute))) { int size = ((SizeAttribute)xpMemberInfo.GetAttributeInfo(typeof(SizeAttribute))).Size; if (size > -1 && value.Length > size) value = value.Substring(0, size - 1); } else if (value.Length > 99) value = value.Substring(0, 99); return value; }