Exemple #1
0
 public CrystalsNotification(
     INotificationBuilder builder,
     IBalanceHandler balanceHandler)
 {
     _builder        = builder;
     _balanceHandler = balanceHandler;
 }
Exemple #2
0
 protected NotificationBuilderFactory(IServiceProvider serviceProvider, Type t1, Type t2)
 {
     _       = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     builder = (INotificationBuilder)(serviceProvider.GetService(t1)
                                      ?? serviceProvider.GetService(t2)
                                      ?? serviceProvider.GetRequiredService(typeof(INotificationBuilder)));
 }
Exemple #3
0
 protected NotificationBuilderFactory(IServiceProvider serviceProvider, params Type[] types)
 {
     _       = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     builder = (from i in types
                let j = serviceProvider.GetService(i) as INotificationBuilder
                        where j != null
                        select j).FirstOrDefault()
               ?? (INotificationBuilder)serviceProvider.GetRequiredService(typeof(INotificationBuilder));
 }
Exemple #4
0
        /// <summary>
        /// Send a notification to each device in the list.
        /// </summary>
        /// <param name="notification">The notification to send.</param>
        /// <param name="devices">The list of devices to which send the notification.</param>
        public void Send(INotification notification, IEnumerable <IDevice> devices)
        {
            NotificationBuildersFactory buildersFactory = NotificationBuildersFactory.Instance;
            INotificationBuilder        builder         = buildersFactory.Create(notification.Builder);
            NotificationPayload         payload         = builder.Build(notification);
            INotificationService        notificationService;

            foreach (IDevice device in devices)
            {
                notificationService = NotificationServiceFactory.Make(device.Type, certificatePath, certificatePassword, senderId, senderAuthToken);
                if (notificationService != null)
                {
                    notificationService.Send(payload, device);
                    device.Notified(notification);
                }
            }
        }
 public PokemonEncounterService(
     ILogger <PokemonEncounterService> logger,
     IOptions <NotificationOptions> options,
     ICheckRepublicService checkRepublicService,
     IIgnoredPokemonService ignoredPokemonService,
     INotificationBuilder notificationBuilder,
     INotificationService notificationService,
     NotificationContext notificationContext)
 {
     _logger  = logger;
     _options = options;
     _checkRepublicService  = checkRepublicService;
     _ignoredPokemonService = ignoredPokemonService;
     _notificationBuilder   = notificationBuilder;
     _notificationService   = notificationService;
     _notificationContext   = notificationContext;
 }
 public BlogService(
     IPostRepository postRepository,
     ICommentRepository commentRepository,
     IPostBuilder postBuilder,
     ICommentBuilder commentBuilder,
     IEmailService emailService,
     INotificationBuilder notificationBuilder,
     BlogOptions options,
     ILogger <BlogService> logger)
 {
     _postRepository      = postRepository;
     _commentRepository   = commentRepository;
     _postBuilder         = postBuilder;
     _commentBuilder      = commentBuilder;
     _emailService        = emailService;
     _notificationBuilder = notificationBuilder;
     _options             = options;
     _logger = logger;
 }
 public NotificationsCenter(INotificationBuilder builder, ILocalStorage localStorage, IEnumerable <INotificationsFetcher> fetchers)
 {
     _builder      = builder;
     _localStorage = localStorage;
     _fetchers     = fetchers;
 }
        //		private readonly ILocalStorage _localStorage;

        public ComparisonNotification(INotificationBuilder builder, ILocalStorage localStorage, ICompareUser comparisonFetcher)
        {
            _builder           = builder;
            _comparisonFetcher = comparisonFetcher;
        }
 public static INotificationBuilder AddDiscord(this INotificationBuilder builder, IConfiguration discordConfiguration)
 {
     builder.Services.Configure <DiscordWebhookLibNotificationSender.Config>(discordConfiguration);
     builder.AddSender <DiscordWebhookLibNotificationSender>();
     return(builder);
 }
Exemple #10
0
 public MorningNotification(INotificationBuilder builder, ILocalStorage localStorage)
 {
     _builder      = builder;
     _localStorage = localStorage;
 }
 public InstantWorkNotificationJob(INotificationBuilder notificationBuilder)
 {
     _notificationBuilder = notificationBuilder;
 }
 public DailyWorkFollowUpReportJob(INotificationBuilder notificationBuilder)
 {
     _notificationBuilder = notificationBuilder;
 }