コード例 #1
0
        public string GetDeliveryContacts(NotificationProtocolType protocol, Users user)
        {
            switch (protocol)
            {
            case NotificationProtocolType.Email:
                return(user.Email);

            default:
                throw new Exception(Resources.Resources.NotificationProtocolIsNotSupported.FormatWith(protocol));
            }
        }
コード例 #2
0
 public INotificationSender Get(NotificationProtocolType protocolType)
 {
     try
     {
         return(_unityContainer.Resolve <INotificationSender>(protocolType.ToString()));
     }
     catch (ResolutionFailedException exc)
     {
         throw new UnknownNotificationProtocolTypeException(protocolType, exc);
     }
 }
コード例 #3
0
 public static IUnityContainer RegisterNotificationSender <T>(this IUnityContainer container,
                                                              NotificationProtocolType protocolType,
                                                              ReuseScope reuseScope)
     where T : class, INotificationSender
 => container.RegisterType <INotificationSender, T>(protocolType.ToString(), reuseScope);
 public UnknownNotificationProtocolTypeException(NotificationProtocolType notificationProtocolType,
                                                 // ReSharper disable once SuggestBaseTypeForParameter
                                                 ResolutionFailedException exc) :
     base(Properties.Resources.UnknownNotificationProtocolType.FormatWith(notificationProtocolType), exc)
 {
 }
コード例 #5
0
 protected BaseNotificationProtocolConfiguration(
     NotificationProtocolType type)
 {
     this.Type = type;
 }