コード例 #1
0
 public QpMonitoringRepository(IConnectionProvider connectionProvider, IArticleFormatter formatter, bool state, string language)
 {
     _customer = connectionProvider.GetCustomer();
     _state    = state;
     _language = String.IsNullOrEmpty(language) ? "invariant" : language;
     _isJson   = formatter is JsonProductFormatter;
 }
コード例 #2
0
        public static async Task WriteAsync(this IArticleFormatter formatter, Stream stream, Article product, IArticleFilter filter, bool includeRegionTags)
        {
            string data = formatter.Serialize(product, filter, includeRegionTags);

            var writer = new StreamWriter(stream);
            await writer.WriteAsync(data);

            await writer.FlushAsync();
        }
コード例 #3
0
 public LocalSystemCachedLoader(IContentDefinitionService definitionService,
                                VersionedCacheProviderBase cacheProvider,
                                ICacheItemWatcher cacheItemWatcher,
                                IReadOnlyArticleService articleService,
                                IFieldService fieldService,
                                ISettingsService settingsService,
                                IList <IConsumerMonitoringService> consumerMonitoringServices,
                                IArticleFormatter formatter, IConnectionProvider connectionProvider) : base(definitionService,
                                                                                                            cacheProvider, cacheItemWatcher, articleService, fieldService, settingsService, consumerMonitoringServices, formatter, connectionProvider)
 {
     DataDirectory = AppDomain.CurrentDomain.GetData("DataDirectory") as string;
     if (DataDirectory == null)
     {
         throw new InvalidOperationException("Должен быть определен DataDirectory");
     }
     ArchiveFiles = true;
 }
コード例 #4
0
        public ProductRelevanceService(
            IArticleFormatter formatter,
            Func <bool, CultureInfo, IConsumerMonitoringService> consumerMonitoringServiceFunc,
            IProductLocalizationService localisationService,
            ILogger logger
            )
        {
            if (formatter == null)
            {
                throw new ArgumentNullException(nameof(formatter));
            }

            _formatter = formatter;
            _consumerMonitoringServiceFunc = consumerMonitoringServiceFunc;
            _localisationService           = localisationService;
            _logger = logger;
        }
コード例 #5
0
 public QpMonitoringRepository(IConnectionProvider connectionProvider, IArticleFormatter formatter, bool state)
     : this(connectionProvider, formatter, state, null)
 {
 }
コード例 #6
0
 public JsonProductArrayFormatter(JsonProductFormatter formatter)
 {
     _formatter = formatter;
 }