/// <summary> /// Load the content /// </summary> public void LoadContent() { Content.Clear(); _NeutralFileContent = TranslationFileContent.Load(NeutralFile, this.Group); if (TranslationsFile == null) { _TranslationsFileContent = null; } else { _TranslationsFileContent = TranslationFileContent.Load(TranslationsFile, this.Group); } // Merge the values foreach (var nValue in _NeutralFileContent.Content) { TranslationFileValue tValue = null; if (_TranslationsFileContent != null) { int pos = Content.Count(c => String.Equals(c.ReferenceKey, nValue.ReferenceKey, StringComparison.OrdinalIgnoreCase)); var tValues = _TranslationsFileContent.Content.Where(c => String.Equals(c.ReferenceKey, nValue.ReferenceKey, StringComparison.OrdinalIgnoreCase)).ToList(); tValue = tValues.Skip(pos).FirstOrDefault(); if (tValue == null) { tValue = new TranslationFileValue { ReferenceGroup = nValue.ReferenceGroup, ReferenceCode = nValue.ReferenceCode, Description = nValue.Description }; _TranslationsFileContent.Content.Add(tValue); } } TranslationContentValue cValue = new TranslationContentValue(this, nValue, tValue); Content.Add(cValue); } }
/// <summary> /// Load a content /// </summary> public static TranslationFileContent Load(TranslationFile file, String group) { TranslationFileContent content = new TranslationFileContent(file, group); content.LoadContent(); return content; }