public DistinguishedNameParser(IDistinguishedNameComponentValidator distinguishedNameComponentValidator) { if (distinguishedNameComponentValidator == null) { throw new ArgumentNullException("distinguishedNameComponentValidator"); } this._distinguishedNameComponentValidator = distinguishedNameComponentValidator; }
public DistinguishedNameComponent(string name, string value, IDistinguishedNameComponentValidator distinguishedNameComponentValidator) { if (distinguishedNameComponentValidator == null) { throw new ArgumentNullException("distinguishedNameComponentValidator"); } var validationResult = distinguishedNameComponentValidator.ValidateName(name); if (!validationResult.IsValid) { throw validationResult.Exceptions.First(); } validationResult = distinguishedNameComponentValidator.ValidateValue(value); if (!validationResult.IsValid) { throw validationResult.Exceptions.First(); } this._name = name; this._value = value; }