Esempio n. 1
0
        public virtual void SendNotification()
        {
            INotificationInfo notificationInfo = GetNotificationInfo();
            IEnumerable <INotificationInfo> notificationInfos = new[] { notificationInfo };

            NotificationInfoUtilities.GetUsers(ref notificationInfos, UserConnection);
            var notificationSender = ClassFactory.Get <INotificationSender>(
                new ConstructorArgument("userConnection", UserConnection));

            notificationSender.Send(notificationInfos);
        }
Esempio n. 2
0
        /// <summary>
        /// Executes notification.
        /// </summary>
        /// <returns>Returns execution status.</returns>
        public bool Execute()
        {
            IEnumerable <INotificationInfo> notificationInfos = GetNotificationInfos();

            if (notificationInfos != null && !notificationInfos.IsEmpty())
            {
                IEnumerable <Guid> users = NotificationInfoUtilities.GetUsers(ref notificationInfos, _userConnection);
                foreach (INotificationInfoHandler handler in Handlers)
                {
                    handler.HandleInfo(notificationInfos, users);
                }
                return(true);
            }
            return(false);
        }