public NotificationController(IHubContext <NotificationsHub> hub, IConfiguration configuration, INotificationsManager notificationsManager, ITokenManager tokenManager, ILogger <NotificationController> logger)
 {
     _logger = logger;
     _hub    = hub;
     _notificationsManager = notificationsManager;
     _tokenManager         = tokenManager;
 }
Esempio n. 2
0
        public WindowsManager(ViewModelLocator viewModelLocator, INotificationsManager notificationsManager,
                              ISettingsManager <ApplicationSettings> settingsManager, IMetaPubSub metaMessenger)
        {
            _viewModelLocator     = viewModelLocator;
            _settingsManager      = settingsManager;
            _notificationsManager = notificationsManager;

            metaMessenger.Subscribe <ShowWarningNotificationMessage>(ShowWarn);
            metaMessenger.Subscribe <ShowInfoNotificationMessage>(ShowInfo);
            metaMessenger.Subscribe <ShowErrorNotificationMessage>(ShowError);
            metaMessenger.Subscribe <ShowLockNotificationMessage>(ShowLockNotification);
            metaMessenger.Subscribe <ShowLowBatteryNotificationMessage>(ShowLowBatteryNotification);

            metaMessenger.TrySubscribeOnServer <WorkstationUnlockedMessage>(ClearNotifications);

            metaMessenger.TrySubscribeOnServer <UserNotificationMessage>((m) => ShowInfo(new ShowInfoNotificationMessage(m.Message, notificationId: m.NotificationId)));
            metaMessenger.TrySubscribeOnServer <UserErrorMessage>((m) => ShowError(new ShowErrorNotificationMessage(m.Message, notificationId: m.NotificationId)));
            //messenger.Register<ServiceNotificationReceivedMessage>(this, (p) => ShowInfo(p.Message, notificationId: p.Id));
            //messenger.Register<ServiceErrorReceivedMessage>(this, (p) => ShowError(p.Message, notificationId: p.Id));

            metaMessenger.Subscribe <ShowButtonConfirmUiMessage>(ShowButtonConfirmAsync);
            metaMessenger.Subscribe <ShowPinUiMessage>(ShowPinAsync);
            metaMessenger.Subscribe <HidePinUiMessage>(HidePinAsync);
            metaMessenger.TrySubscribeOnServer <ShowActivationCodeUiMessage>(ShowActivationDialogAsync);
            metaMessenger.TrySubscribeOnServer <HideActivationCodeUi>(HideActivationDialogAsync);

            metaMessenger.Subscribe <ShowActivateMainWindowMessage>((p) => ActivateMainWindow());
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScrumTeamManager"/> class.
 /// </summary>
 /// <param name="notificationsManager">The notifications manager.</param>
 /// <param name="teamMemberValidator">The team member validator.</param>
 public ScrumTeamManager(INotificationsManager notificationsManager,
                         ITeamMemberValidator teamMemberValidator)
 {
     // TIP: use constructor for dependency injection to avoid Injection Parameters
     // TIP: use Initialize method or initial data provider to pass some initial data
     this.notificationsManager = notificationsManager;
     this.teamMemberValidator  = teamMemberValidator;
 }
Esempio n. 4
0
 public NotificationsSubscriptionsHandler(
     ILogger <NotificationsSubscriptionsHandler> logger,
     INotificationsManager notificationsManager
     )
 {
     _logger = logger;
     _notificationsManager = notificationsManager;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CommentsManager"/> class
 /// </summary>
 /// <param name="commentsStore">Comments store</param>
 /// <param name="fanoutActivitiesQueue"><c>Fanout</c> activities queue</param>
 /// <param name="notificationsManager">Notifications manager</param>
 public CommentsManager(
     ICommentsStore commentsStore,
     IFanoutActivitiesQueue fanoutActivitiesQueue,
     INotificationsManager notificationsManager)
 {
     this.commentsStore         = commentsStore;
     this.fanoutActivitiesQueue = fanoutActivitiesQueue;
     this.notificationsManager  = notificationsManager;
 }
Esempio n. 6
0
 public BidsController(IBidsManager bidsManager, INotificationsManager notificationsManager, IAuthorizationService authorizationService, IServiceScopeFactory scopeFactory, IOptions <MailSettings> mailSettings, IOptions <MailSecrets> mailSecrets)
 {
     this.bidsManager          = bidsManager;
     this.notificationsManager = notificationsManager;
     this.authorizationService = authorizationService;
     this.scopeFactory         = scopeFactory;
     this.mailPassword         = mailPassword;
     this.mailService          = new MailService(mailSettings.Value, mailSecrets.Value);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RepliesManager"/> class
 /// </summary>
 /// <param name="repliesStore">Comments store</param>
 /// <param name="fanoutActivitiesQueue"><c>Fanout</c> activities queue</param>
 /// <param name="notificationsManager">Notifications manager</param>
 public RepliesManager(
     IRepliesStore repliesStore,
     IFanoutActivitiesQueue fanoutActivitiesQueue,
     INotificationsManager notificationsManager)
 {
     this.repliesStore          = repliesStore;
     this.fanoutActivitiesQueue = fanoutActivitiesQueue;
     this.notificationsManager  = notificationsManager;
 }
Esempio n. 8
0
        public UpdateChecker(IAppInfo appInfo, INotificationsManager notificationsManager, IIOSettingsManager ioSettingsManager, ILogger <UpdateChecker> logger)
        {
            this.appInfo = appInfo;
            this.notificationsManager = notificationsManager;
            this.logger = logger;

            checkPrereleasesSetting = ioSettingsManager.GetSetting(AppUISettingsFactory.CheckForPrereleases);
            checkUpdatesOnStartUp   = ioSettingsManager.GetSetting(AppUISettingsFactory.CheckUpdatesOnStartUp);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MyNotificationsController"/> class
 /// </summary>
 /// <param name="log">Log</param>
 /// <param name="notificationsManager">Notifications manager</param>
 /// <param name="viewsManager">Views manager</param>
 public MyNotificationsController(
     ILog log,
     INotificationsManager notificationsManager,
     IViewsManager viewsManager)
 {
     this.log = log;
     this.notificationsManager = notificationsManager;
     this.viewsManager         = viewsManager;
 }
Esempio n. 10
0
        public NotificationsManagerTests()
        {
            var notificationsRepositoryMock = new MongoRepositoryMockFactory <NotificationEntity>(_notificationEntities)
                                              .GetInstance();

            _manager = new NotificationsManager(
                new Mock <ILogger <NotificationsManager> >().Object,
                new NotificationsService(notificationsRepositoryMock.Object)
                );
        }
 /// <summary>
 /// Executes when a message is received indicating notifications
 /// have been setup on the client OS. Time to setup the same
 /// with the mobile apps backend.
 /// </summary>
 /// <param name="mgr">The INotificationsManager that raised the event</param>
 private async void NotificationsReady(INotificationsManager mgr)
 {
     try
     {
         //use the mobile client wrapper to register with the mobile app
         await _client.RegisterForNotificationsAsync();
     }
     catch (Exception ex)
     {
         Device.BeginInvokeOnMainThread(() =>
                                        ((NavigationPage)MainPage).CurrentPage.DisplayAlert("Push registration error", ex.Message, "OK"));
         System.Diagnostics.Debug.WriteLine(ex.Message);
     }
 }
Esempio n. 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LikesManager"/> class
 /// </summary>
 /// <param name="likesStore">Likes store</param>
 /// <param name="topicsStore">Topics store</param>
 /// <param name="usersStore">Users store</param>
 /// <param name="likesQueue">Likes queue</param>
 /// <param name="fanoutActivitiesQueue"><c>Fanout</c> activities queue</param>
 /// <param name="popularTopicsManager">Popular topics manager</param>
 /// <param name="notificationsManager">Notifications manager</param>
 public LikesManager(
     ILikesStore likesStore,
     ITopicsStore topicsStore,
     IUsersStore usersStore,
     ILikesQueue likesQueue,
     IFanoutActivitiesQueue fanoutActivitiesQueue,
     IPopularTopicsManager popularTopicsManager,
     INotificationsManager notificationsManager)
 {
     this.likesStore            = likesStore;
     this.topicsStore           = topicsStore;
     this.usersStore            = usersStore;
     this.likesQueue            = likesQueue;
     this.fanoutActivitiesQueue = fanoutActivitiesQueue;
     this.popularTopicsManager  = popularTopicsManager;
     this.notificationsManager  = notificationsManager;
 }
Esempio n. 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RelationshipsManager"/> class
 /// </summary>
 /// <param name="log">Log</param>
 /// <param name="userRelationshipsStore">User relationships store</param>
 /// <param name="topicRelationshipsStore">Topic relationships store</param>
 /// <param name="relationshipsQueue">Relationships queue</param>
 /// <param name="fanoutActivitiesQueue"><c>Fanout</c> activities queue</param>
 /// <param name="followingImportsQueue">Following imports queue</param>
 /// <param name="popularUsersManager">Popular users manager</param>
 /// <param name="notificationsManager">Notifications manager</param>
 public RelationshipsManager(
     ILog log,
     IUserRelationshipsStore userRelationshipsStore,
     ITopicRelationshipsStore topicRelationshipsStore,
     IRelationshipsQueue relationshipsQueue,
     IFanoutActivitiesQueue fanoutActivitiesQueue,
     IFollowingImportsQueue followingImportsQueue,
     IPopularUsersManager popularUsersManager,
     INotificationsManager notificationsManager)
 {
     this.log = log;
     this.userRelationshipsStore  = userRelationshipsStore;
     this.topicRelationshipsStore = topicRelationshipsStore;
     this.relationshipsQueue      = relationshipsQueue;
     this.fanoutActivitiesQueue   = fanoutActivitiesQueue;
     this.followingImportsQueue   = followingImportsQueue;
     this.popularUsersManager     = popularUsersManager;
     this.notificationsManager    = notificationsManager;
 }
        /// <summary>
        /// Registers for notifications with the mobile serivce.
        /// First invokes platform specific code, then updates the tags
        /// using a custom controller on the backend.
        /// </summary>
        /// <returns>True if registration succeeded with no errors or false if errors occurred.</returns>
        public async Task <bool> RegisterForNotificationsAsync()
        {
            var tags = GetPushTags();

            //use the dependency service to get the platform specific implementation
            INotificationsManager manager = Xamarin.Forms.DependencyService.Get <INotificationsManager>();

            if (manager != null)
            {
                //invoke the client specific registration
                await manager.RegisterForPushNotifications(_client);

                //if we succeeded in registering with the mobile app
                //then call back to update with the tags (set on the settings view)
                await UpdateRegistrationWithTags(tags);

                return(true);
            }
            else
            {
                return(false);
            }
        }
 public PaymentController(IPaymentDatabase paymentDatabase, INotificationsManager notificationsManager)
 {
     _paymentDatabase      = paymentDatabase;
     _notificationsManager = notificationsManager;
 }
Esempio n. 16
0
 public CustomerController(ICustomerDatabase customerDatabase, INotificationsManager notificationServiceClient)
 {
     _customerDatabase          = customerDatabase;
     _notificationServiceClient = notificationServiceClient;
 }
Esempio n. 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NotificationsController"/> class.
 /// </summary>
 /// <param name="notificationsManager">The instance for <see cref="INotificationsManager"/>.</param>
 /// <param name="logger">The instance for <see cref="ILogger{NotificationsController}"/>.</param>
 /// <exception cref="ArgumentNullException">
 /// logger
 /// or
 /// notificationsManager.
 /// </exception>
 public NotificationsController(INotificationsManager notificationsManager, ILogger <NotificationsController> logger)
 {
     this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
     this.notificationsManager = notificationsManager ?? throw new ArgumentNullException(nameof(notificationsManager));
 }
Esempio n. 18
0
 public void Setup()
 {
     _notificationsManager = Substitute.For<INotificationsManager>();
     _entityManager = Substitute.For<IEntityManager>();
     _client = new Client(null, null) {NotificationsManager = _notificationsManager, EntityManager = _entityManager};
 }
Esempio n. 19
0
 public NotificationsController(ISubscriptionsService subscriptionsService,
                                INotificationsManager notificationsManager)
 {
     this.subscriptionsService = subscriptionsService;
     this.notificationsManager = notificationsManager;
 }
 public NotificationsController(INotificationsManager notificationsManager, ICommonOperationsManager commonOperationsManager)
 {
     _notificationsManager    = notificationsManager;
     _commonOperationsManager = commonOperationsManager;
 }