Пример #1
0
 public PizzaPlanner(ILogger logger, BotConfig config, IFileStorage storage, IPizzaInviter pizzaInviter, IPizzaCore core, IOptOutState optOutState, IActivityLog activityLog, Func <DateTimeOffset> funcNow)
 {
     _activityLog  = activityLog ?? throw new ArgumentNullException(nameof(activityLog));
     _funcNow      = funcNow ?? throw new ArgumentNullException(nameof(funcNow));
     _logger       = logger ?? throw new ArgumentNullException(nameof(logger));
     _storage      = storage ?? throw new ArgumentNullException(nameof(storage));
     _pizzaInviter = pizzaInviter ?? throw new ArgumentNullException(nameof(pizzaInviter));
     _core         = core ?? throw new ArgumentNullException(nameof(core));
     _optOutState  = optOutState ?? throw new ArgumentNullException(nameof(optOutState));
     _config       = config ?? throw new ArgumentNullException(nameof(config));
 }
Пример #2
0
        public PizzaServiceHost(ILogger logger, CancellationTokenSource cts, IPizzaCore pizzaCore, IPizzaInviter inviter, PizzaPlanner planner, IOptOutHandler optOutHandler, IAnnouncementHandler annoucementHandler, IActivityLog activityLog)
        {
            _activityLog = activityLog ?? throw new ArgumentNullException(nameof(activityLog));
            _logger      = logger ?? throw new ArgumentNullException(nameof(logger));
            _cts         = cts ?? throw new ArgumentNullException(nameof(cts));
            _pizzaCore   = pizzaCore ?? throw new ArgumentNullException(nameof(pizzaCore));

            _resources = new List <IMustBeInitialized>()
            {
                inviter, planner, optOutHandler, annoucementHandler
            };
            _handlers = new List <IMessageHandler>()
            {
                inviter, optOutHandler
            };
        }