コード例 #1
0
        public MessageTokenProvider(ILanguageService languageService,
            ILocalizationService localizationService, IDateTimeHelper dateTimeHelper,
            IEmailAccountService emailAccountService,
            IPriceFormatter priceFormatter, ICurrencyService currencyService,IWebHelper webHelper,
            IWorkContext workContext, IDownloadService downloadService,
            IOrderService orderService,
            StoreInformationSettings storeSettings, MessageTemplatesSettings templatesSettings,
            EmailAccountSettings emailAccountSettings, CatalogSettings catalogSettings,
            TaxSettings taxSettings)
        {
            this._languageService = languageService;
            this._localizationService = localizationService;
            this._dateTimeHelper = dateTimeHelper;
            this._emailAccountService = emailAccountService;
            this._priceFormatter = priceFormatter;
            this._currencyService = currencyService;
            this._webHelper = webHelper;
            this._workContext = workContext;
            this._downloadService = downloadService;
            this._orderService = orderService;

            this._storeSettings = storeSettings;
            this._templatesSettings = templatesSettings;
            this._emailAccountSettings = emailAccountSettings;
            this._catalogSettings = catalogSettings;
            this._taxSettings = taxSettings;
        }
コード例 #2
0
        public MessageTokenProvider(ILanguageService languageService,
            ILocalizationService localizationService, IDateTimeHelper dateTimeHelper,
            IEmailAccountService emailAccountService,
            IPriceFormatter priceFormatter, ICurrencyService currencyService,IWebHelper webHelper,
            IWorkContext workContext, IDownloadService downloadService,
            IOrderService orderService, IPaymentService paymentService,
            IProductAttributeParser productAttributeParser,
            MessageTemplatesSettings templatesSettings,
            EmailAccountSettings emailAccountSettings, CatalogSettings catalogSettings,
            TaxSettings taxSettings, IEventPublisher eventPublisher)
        {
            this._languageService = languageService;
            this._localizationService = localizationService;
            this._dateTimeHelper = dateTimeHelper;
            this._emailAccountService = emailAccountService;
            this._priceFormatter = priceFormatter;
            this._currencyService = currencyService;
            this._webHelper = webHelper;
            this._workContext = workContext;
            this._downloadService = downloadService;
            this._orderService = orderService;
            this._paymentService = paymentService;
            this._productAttributeParser = productAttributeParser;

            this._templatesSettings = templatesSettings;
            this._emailAccountSettings = emailAccountSettings;
            this._catalogSettings = catalogSettings;
            this._taxSettings = taxSettings;
            this._eventPublisher = eventPublisher;
        }
コード例 #3
0
 public MobSocialMessageService(IMessageTemplateService messageTemplateService,
                                    IStoreService storeService, IMessageTokenProvider messageTokenProvider,
                                    ILanguageService languageService,
                                    IStoreContext storeContext,
                                    IEventPublisher eventPublisher,
                                    ITokenizer tokenizer, IQueuedEmailService queuedEmailService,
                                    IEmailAccountService emailAccountService,
                                    EmailAccountSettings emailAccountSettings,
                                    ILocalizationService localizationService,
                                    MessageTemplatesSettings messageTemplateSettings,
                                    CatalogSettings catalogSettings,
                                    IProductAttributeParser productAttributeParser, IWorkContext workContext)
 {
     _messageTemplateService = messageTemplateService;
     _storeService = storeService;
     _messageTokenProvider = messageTokenProvider;
     _languageService = languageService;
     _storeContext = storeContext;
     _eventPublisher = eventPublisher;
     _tokenizer = tokenizer;
     _queuedEmailService = queuedEmailService;
     _emailAccountService = emailAccountService;
     _emailAccountSettings = emailAccountSettings;
     _localizationService = localizationService;
     _messageTemplateSettings = messageTemplateSettings;
     _catalogSettings = catalogSettings;
     _productAttributeParser = productAttributeParser;
     _workContext = workContext;
 }
コード例 #4
0
ファイル: TokenizerTests.cs プロジェクト: nvolpe/raver
        public void Can_replace_tokens_case_invariant()
        {
            var messageTemplatesSettings = new MessageTemplatesSettings
            {
                CaseInvariantReplacement = true
            };
            var tokenizer = new Tokenizer(messageTemplatesSettings);

            var tokens = new List<Token>
            {
                new Token("Token1", "Value1")
            };
            tokenizer
                .Replace("Some text %TOKEn1%", tokens, false)
                .ShouldEqual("Some text Value1");
        }
コード例 #5
0
ファイル: TokenizerTests.cs プロジェクト: nvolpe/raver
        public void Should_not_html_encode_if_token_doesnt_allow_it()
        {
            var messageTemplatesSettings = new MessageTemplatesSettings
            {
                CaseInvariantReplacement = false
            };
            var tokenizer = new Tokenizer(messageTemplatesSettings);

            var tokens = new List<Token>
            {
                new Token("Token1", "<Value1>", true)
            };

            tokenizer
                .Replace("Some text %Token1%", tokens, true)
                .ShouldEqual("Some text <Value1>");
        }
コード例 #6
0
ファイル: TokenizerTests.cs プロジェクト: nvolpe/raver
        public void Can_html_encode()
        {
            var messageTemplatesSettings = new MessageTemplatesSettings
            {
                CaseInvariantReplacement = false
            };
            var tokenizer = new Tokenizer(messageTemplatesSettings);

            var tokens = new List<Token>
            {
                new Token("Token1", "<Value1>")
            };

            tokenizer
                .Replace("Some text %Token1%", tokens, true)
                .ShouldEqual("Some text &lt;Value1&gt;");
        }
コード例 #7
0
ファイル: MessageTokenProvider.cs プロジェクト: nvolpe/raver
        public MessageTokenProvider(ILanguageService languageService,
            ILocalizationService localizationService, 
            IDateTimeHelper dateTimeHelper,
            IPriceFormatter priceFormatter, 
            ICurrencyService currencyService,
            IWorkContext workContext,
            IDownloadService downloadService,
            IOrderService orderService,
            IPaymentService paymentService,
            IStoreService storeService,
            IStoreContext storeContext,
            IProductAttributeParser productAttributeParser,
            IAddressAttributeFormatter addressAttributeFormatter,
            MessageTemplatesSettings templatesSettings,
            CatalogSettings catalogSettings,
            TaxSettings taxSettings,
            CurrencySettings currencySettings,
            ShippingSettings shippingSettings,
            IEventPublisher eventPublisher,
            StoreInformationSettings storeInformationSettings)
        {
            this._languageService = languageService;
            this._localizationService = localizationService;
            this._dateTimeHelper = dateTimeHelper;
            this._priceFormatter = priceFormatter;
            this._currencyService = currencyService;
            this._workContext = workContext;
            this._downloadService = downloadService;
            this._orderService = orderService;
            this._paymentService = paymentService;
            this._productAttributeParser = productAttributeParser;
            this._addressAttributeFormatter = addressAttributeFormatter;
            this._storeService = storeService;
            this._storeContext = storeContext;

            this._templatesSettings = templatesSettings;
            this._catalogSettings = catalogSettings;
            this._taxSettings = taxSettings;
            this._currencySettings = currencySettings;
            this._shippingSettings = shippingSettings;
            this._eventPublisher = eventPublisher;
            this._storeInformationSettings = storeInformationSettings;
        }
コード例 #8
0
ファイル: TokenizerTests.cs プロジェクト: nvolpe/raver
        public void Can_replace_tokens_case_sensitive()
        {
            var messageTemplatesSettings = new MessageTemplatesSettings
            {
                CaseInvariantReplacement = false
            };
            var tokenizer = new Tokenizer(messageTemplatesSettings);

            var tokens = new List<Token>
            {
                new Token("Token1", "Value1")
            };
            //correct case
            tokenizer
                .Replace("Some text %Token1%", tokens, false)
                .ShouldEqual("Some text Value1");
            //wrong case
            tokenizer
                .Replace("Some text %TOKeN1%", tokens, false)
                .ShouldEqual("Some text %TOKeN1%");
        }
コード例 #9
0
ファイル: Tokenizer.cs プロジェクト: RobinHoody/nopCommerce
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="settings">Message templates settings</param>
 public Tokenizer(MessageTemplatesSettings settings)
 {
     _stringComparison = settings.CaseInvariantReplacement ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
 }