コード例 #1
0
        public LicenseActivator(IConfiguration confirguration, ESUContext context, IConfirmationProvider confirmationProvider, ILogger <LicenseActivator> logger)
        {
            this.logger         = logger;
            this.confirguration = confirguration;
            this.FirstRun       = DateTime.Now;
            this.logger.LogInformation("Starting license activator...");
            this.confirmationProvider = confirmationProvider;
            this.context  = context;
            this.licenses = new ConcurrentQueue <License>();
            this.timer    = this.GetTimer(this.confirguration);

            this.Loop();
        }
コード例 #2
0
        /// <summary>
        /// Construct StandardEmailConfirmatorFactory.
        /// </summary>
        /// <param name="serviceProvider">Standard serivce provider from startup scope. Can by passed directly from DIC</param>
        /// <param name="confirmatorType">Type of confirmator, used in select implemetation of <code>IConfirmationProvider</code>,<code>IConfirmationTokenProvider</code> and <code>IMessageBodyProvider</code> setup in Startup.cs</param>
        /// <param name="messageTemplate">Message template name see templates.json file"/></param>
        public StandardEmailConfirmatorFactory(
            IServiceProvider serviceProvider,
            ConfirmatorType confirmatorType,
            string messageTemplate)
        {
            this.serviceProvider = serviceProvider;
            this.messageTemplate = messageTemplate;

            confirmationProvider = serviceProvider.GetService <Func <ConfirmatorType, IConfirmationProvider> >()
                                   .Invoke(confirmatorType);

            confirmationTokenProvider = serviceProvider.GetService <Func <ConfirmatorType, IConfirmationTokenProvider> >()
                                        .Invoke(confirmatorType);

            messageBodyProvider = serviceProvider.GetService <Func <ConfirmatorType, IMessageBodyProvider> >()
                                  .Invoke(confirmatorType);
        }