public void AddResource(TranslatedResource resource) { if (string.IsNullOrEmpty(resource.Name) || string.IsNullOrEmpty(resource.Text)) { return; } ReferenceResource existingReferenceResource = _referenceResources.FirstOrDefault(r => r.Resource.Name == resource.Name); if (existingReferenceResource != null && !ReplaceExistingResources) { return; } if (ReplaceExistingResources) { _referenceResources.Remove(existingReferenceResource); } _referenceResources.Add(new ReferenceResource(resource)); }
public ReferenceResource(TranslatedResource resource) { Resource = resource; _resourceNameParts = GetResourceParts(Resource.Name); }