///<inheritdoc/>
        public TreeLocalizationContainer Load(string jsonString)
        {
            if (string.IsNullOrWhiteSpace(jsonString))
            {
                throw new ArgumentNullException(nameof(jsonString));
            }

            TreeLocalizationContainer result = null;

            try
            {
                var sw = Stopwatch.StartNew();

                result = SerializationHelper.LoadFromJsonString <TreeLocalizationContainer>(jsonString);

                sw.Stop();
                _logger.Trace($"loading tree localization took: {sw.ElapsedMilliseconds}ms");

                if (result != null)
                {
                    _logger.Info($"Loaded tree localization version: {result.Version}");
                }
            }
            catch (Exception ex)
            {
                _logger.Error(ex, "Error loading tree localization.");
                throw;
            }

            return(result);
        }
Beispiel #2
0
 public TreeLocalization(ICommons commonsToUse, TreeLocalizationContainer treeLocalizationContainerToUse)
 {
     _commons = commonsToUse;
     _treeLocalizationContainer = treeLocalizationContainerToUse;
 }