Movign to WorkContext rather that IWorkContextAccessor

This commit is contained in:
Nicholas Mayne
2014-08-30 16:10:18 +01:00
parent 8edd49244a
commit b469d623d8

View File

@@ -11,7 +11,7 @@ namespace TinyMce.Services {
private readonly ICacheManager _cacheManager;
private readonly ISignals _signals;
private readonly IVirtualPathProvider _virtualPathProvider;
private readonly IWorkContextAccessor _workContextAccessor;
private readonly WorkContext _workContext;
private const string CacheKeyFormat = "tinymce-locales-{0}";
private const string DefaultLanguage = "en";
@@ -19,12 +19,12 @@ namespace TinyMce.Services {
public TinyMceShapeDisplayEvent(
ICacheManager cacheManager,
IVirtualPathProvider virtualPathProvider,
IWorkContextAccessor workContextAccessor,
WorkContext workContext,
ISignals signals) {
_signals = signals;
_cacheManager = cacheManager;
_virtualPathProvider = virtualPathProvider;
_workContextAccessor = workContextAccessor;
_workContext = workContext;
}
public override void Displaying(ShapeDisplayingContext context) {
@@ -40,7 +40,7 @@ namespace TinyMce.Services {
}
private string GetTinyMceLanguageIdentifier() {
var currentCulture = CultureInfo.GetCultureInfo(_workContextAccessor.GetContext().CurrentCulture);
var currentCulture = CultureInfo.GetCultureInfo(_workContext.CurrentCulture);
if (currentCulture.Name.Equals(DefaultLanguage, StringComparison.OrdinalIgnoreCase))
return currentCulture.Name;