private static void ValidateStringValue(String propertyName, String propertyValue) { if (propertyValue.Length > c_maxStringValueLength) { throw new VssPropertyValidationException("value", CommonResources.InvalidPropertyValueSize(propertyName, typeof(String).FullName, c_maxStringValueLength)); } ArgumentUtility.CheckStringForInvalidCharacters(propertyValue, "value", true); }
public static void ValidateAttributeName(string attributeName) { ArgumentUtility.CheckStringForNullOrEmpty(attributeName, "attributeName", true); ArgumentUtility.CheckStringForInvalidCharacters(attributeName, "attributeName"); if (attributeName.Contains(Semicolon)) { throw new ArgumentException("Attribute name cannot contain the character ';'", attributeName); } }
public static void ValidateContainerName(string containerName) { ArgumentUtility.CheckStringForNullOrEmpty(containerName, "containerName", true); ArgumentUtility.CheckStringForInvalidCharacters(containerName, "containerName"); if (containerName.Contains(Semicolon)) { throw new ArgumentException("Container name cannot contain the character ';'", containerName); } }
/// <summary> /// Validation helper for validating all property strings. /// </summary> /// <param name="propertyString"></param> /// <param name="maxSize"></param> /// <param name="argumentName"></param> private static void ValidatePropertyString(String propertyString, Int32 maxSize, String argumentName) { ArgumentUtility.CheckStringForNullOrEmpty(propertyString, argumentName); if (propertyString.Length > maxSize) { throw new VssPropertyValidationException(argumentName, CommonResources.PropertyArgumentExceededMaximumSizeAllowed(argumentName, maxSize)); } ArgumentUtility.CheckStringForInvalidCharacters(propertyString, argumentName, true); }