Пример #1
0
        internal static string TrimStringValue(ADObjectSchema schema, ADPropertyDefinition propertyDefinition, string value)
        {
            if (propertyDefinition == null)
            {
                throw new ArgumentNullException("propertyDefinition");
            }
            if (string.IsNullOrEmpty(value))
            {
                return(value);
            }
            int stringConstraintLength = MobileDevice.GetStringConstraintLength(schema, propertyDefinition);

            if (value.Length > stringConstraintLength)
            {
                return(value.Remove(stringConstraintLength));
            }
            return(value);
        }