/// <summary> /// The method throws an Exception of type <see cref="TException" /> if the Fiel is not valid. /// </summary> /// <typeparam name="TType"> /// Type of the argument. /// </typeparam> /// <typeparam name="TException"> /// Type of the exception that will be thrown. /// </typeparam> /// <param name="validator"> /// Validator that perfmorms the validation. /// </param> /// <param name="detailType"> /// Enum that defines witch detail is under evaluation. /// </param> /// <param name="country"> /// Country to perform the validation. /// </param> /// <param name="field"> /// Field to validate. /// </param> /// <param name="fieldName"> /// Name of the field to validate. /// </param> /// <exception> /// If the Field is not valid, an Exception of type <see cref="TException" /> will be thrown. /// </exception> protected static void CheckIsValidArgument <TType, TException>( IDetailValidator validator, DetailType detailType, ICountry country, string field, string fieldName) where TException : InvalidBbanDetailException { if (!validator.IsValid(country, field)) { throw (TException)Activator.CreateInstance( typeof(TException), detailType, string.Format( "Parameter '{0}' of type '{1}' is not valid.", detailType, typeof(TType).Name)); } }
protected ASplitter(IDetailValidator validator) { Validator = validator; }