예제 #1
0
 private void ValidatePrivateUse()
 {
     if (_privateUse.Contains("x"))
     {
         throw new ValidationException("Private Use tag may not contain 'x'");
     }
     _privateUse.ThrowIfSubtagContainsInvalidContent();
     _privateUse.ThrowIfSubtagContainsDuplicates();
 }
예제 #2
0
        private void ValidateVariant()
        {
            var invalidPart = _variant.AllParts.FirstOrDefault(part => !StandardSubtags.IsValidRegisteredVariantCode(part));

            if (!String.IsNullOrEmpty(invalidPart))
            {
                throw new ValidationException(
                          String.Format("'{0}' is not a valid registered variant code.", invalidPart)
                          );
            }
            _variant.ThrowIfSubtagContainsDuplicates();
        }