예제 #1
0
        public CustomStyleSettings GetCustomStyleSettings()
        {
            if (!_memoryCache.TryGetValue <CustomStyleSettings>(CacheKey, out var settings))
            {
                settings = new CustomStyleSettings()
                {
                    SiteLogo    = _options.SiteLogo,
                    SiteFavicon = _options.SiteFavicon
                };

                // First get a new token.
                var changeToken = ChangeToken;

                _memoryCache.Set(CacheKey, settings, changeToken);
            }

            return(settings);
        }
예제 #2
0
 public CustomStyleSettingsService(
     IOptions <CustomStyleSettings> options,
     ISignal signal,
     IMemoryCache memoryCache,
     IServiceProvider serviceProvider,
     ILogger <CustomStyleSettingsService> logger,
     IShellHost orchardHost,
     ShellSettings currentShellSettings
     )
 {
     _options              = options.Value;
     _signal               = signal;
     _memoryCache          = memoryCache;
     _serviceProvider      = serviceProvider;
     _logger               = logger;
     _orchardHost          = orchardHost;
     _currentShellSettings = currentShellSettings;
 }