Exemplo n.º 1
0
        protected CodeGeneratorBase(
            CodeGeneratorOptions options = null,
            IAlphabet alphabet           = null,
            IRandomizer randomizer       = null,
            IUniqueness uniqueness       = null,
            IStopWords stopWords         = null,
            ITransformer transformer     = null
            )
        {
            this.transformer = transformer;
            this.options     = options ?? new CodeGeneratorOptions();
            this.alphabet    = alphabet ?? new AsciiAlphabet();
            this.randomizer  = randomizer ?? new RandomRandomizer();
            this.uniqueness  = uniqueness ?? new NoUniqueness();
            this.stopWords   = stopWords ?? new NoStopWords();

            listeners = new object[]
            {
                this.alphabet,
                this.randomizer,
                this.uniqueness,
                this.stopWords
            }
            .Where(x => x is IListener)
            .Cast <IListener>()
            .ToList();
        }
Exemplo n.º 2
0
 public CodeGenerator(CodeGeneratorOptions options = null,
                      IAlphabet alphabet           = null,
                      IRandomizer randomizer       = null,
                      IUniqueness uniqueness       = null,
                      IStopWords stopWords         = null,
                      ITransformer transformer     = null
                      )
     : base(options, alphabet, randomizer, uniqueness, stopWords, transformer)
 {
 }
Exemplo n.º 3
0
 public ICodeGenerator CreateGenerator <T>(CodeGeneratorOptions options = null,
                                           IAlphabet alphabet           = null,
                                           IRandomizer randomizer       = null,
                                           IUniqueness uniqueness       = null,
                                           IStopWords stopWords         = null,
                                           ITransformer transformer     = null)
     where T : ICodeGenerator
 {
     return((ICodeGenerator)Activator.CreateInstance(typeof(T), options, alphabet, randomizer, uniqueness, stopWords, transformer));
 }