Exemplo n.º 1
0
        protected void CheckConfiguration(CodeGeneratorConfigurationBase configuration)
        {
            var allowedChars = new AllowedCharactersBuilder().BuildFromConfiguration(configuration.AllowedCharacters);

            if (allowedChars == null || allowedChars.Length == 0)
            {
                throw new ConfigurationErrorsException("No allowed chars. Configuration resolves to empty list.");
            }

            if (configuration.CodeLength <= 0)
            {
                throw new ConfigurationErrorsException("Not allowed code length. Code length must be greater then zero.");
            }
        }
Exemplo n.º 2
0
 protected override char[] GetAllowedChars(CodeGeneratorConfigurationBase configuration)
 {
     return(new AllowedCharactersBuilder()
            .BuildFromConfiguration(configuration.AllowedCharacters)); //HACK load requirements from Identity and check it
 }
Exemplo n.º 3
0
 protected virtual char[] GetAllowedChars(CodeGeneratorConfigurationBase configuration)
 {
     return(new AllowedCharactersBuilder().BuildFromConfiguration(configuration.AllowedCharacters));
 }
Exemplo n.º 4
0
 protected GeneratorBase(IGenericCodeGenerator genericCodeGenerator, CodeGeneratorConfigurationBase configuration)
 {
     m_genericCodeGenerator = genericCodeGenerator;
     m_configuration        = configuration;
     CheckConfiguration(configuration);
 }