示例#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();
        }
示例#2
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));
 }
示例#3
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)
 {
 }
示例#4
0
 public QueueListenerHostedService(IContainerResolve provider,
                                   IMessageHandlerTypes messageHandlers,
                                   IUniqueness unique,
                                   IQueueStreamManager queueStreamManager,
                                   ILogger <QueueListenerHostedService> logger)
 {
     _provider           = provider;
     _messageHandlers    = messageHandlers;
     _queueParameters    = unique.GetQueues();
     _logger             = logger;
     _queueStreamManager = queueStreamManager;
 }