예제 #1
0
 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);
 }
예제 #2
0
 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;
 }