Beispiel #1
0
        private void AddLanguageResourceToBundle(LanguageResourceBundle langResBundle, XmlNode resource)
        {
            var allResourceTypes = new List <string>()
            {
                "Variables", "Abbreviations", "OrdinalFollowers"
            };

            var resourceAdder = new Resource();

            foreach (var resourceType in allResourceTypes)
            {
                if (resourceType == resource?.Attributes?["Type"].Value)
                {
                    resourceAdder.SetResourceType(new WordlistResource(resource, resourceType));
                    resourceAdder.AddLanguageResourceToBundle(langResBundle);
                }
            }

            if (resource?.Attributes?["Type"].Value == "SegmentationRules")
            {
                resourceAdder.SetResourceType(new SegmentationRulesResource(resource));
                resourceAdder.AddLanguageResourceToBundle(langResBundle);
            }
        }