コード例 #1
0
        public LicalizedTemplateLocator(TemplateLocatorSettings templateLocatorSettings)
        {
            if (templateLocatorSettings == null)
            {
                throw new ArgumentNullException("templateLocatorSettings");
            }

            _templateLocatorSettings = templateLocatorSettings;
        }
コード例 #2
0
        public static void InitNotification(Container container)
        {
            var mailSettings = new MailSettings
            {
                SmtpOptions = new SmtpOptions()
            };

            var templateLocatorSettings = new TemplateLocatorSettings();

            container.Register <INotificationManager>(c => new NotificationManager());

            container.Resolve <INotificationManager>().DeliveryMethodProvider
            .Register("email", new EmailDeliveryMethod(mailSettings));

            container.Resolve <INotificationManager>().MessageGeneratorProvider
            .Register("email", new RazorMessageGenerator(templateLocatorSettings));
        }
コード例 #3
0
 public RazorMessageGenerator(TemplateLocatorSettings templateLocatorSettings)
     : this(new LicalizedTemplateLocator(templateLocatorSettings))
 {
 }