Ejemplo n.º 1
0
        /// <summary>
        /// Adds the language represented by the specified file.
        /// </summary>
        /// <param name="file">The file.</param>
        public void AddLanguage(ProjectFile file)
        {
            var cultureKey       = file.GetCultureKey(Container.Configuration.NeutralResourcesLanguage);
            var resourceLanguage = new ResourceLanguage(this, cultureKey, file, Container.Configuration.DuplicateKeyHandling);

            _languages.Add(cultureKey, resourceLanguage);
            _resourceTableEntries.ForEach(entry => entry.Refresh());

            Container.LanguageAdded(resourceLanguage.CultureKey);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds the language represented by the specified file.
        /// </summary>
        /// <param name="file">The file.</param>
        public void AddLanguage([NotNull] ProjectFile file)
        {
            var cultureKey       = file.GetCultureKey(Container.Configuration);
            var resourceLanguage = new ResourceLanguage(this, cultureKey, file);

            _languages.Add(cultureKey, resourceLanguage);
            _resourceTableEntries.ForEach(entry => entry.Refresh());

            Container.LanguageAdded(resourceLanguage.CultureKey);
        }
Ejemplo n.º 3
0
        public bool Update(ProjectFile file, [NotNullWhen(true)] out ResourceLanguage?updatedLanguage)
        {
            var duplicateKeyHandling = Container.Configuration.DuplicateKeyHandling;

            updatedLanguage = new ResourceLanguage(this, file.GetCultureKey(NeutralResourcesLanguage), file, duplicateKeyHandling);
            if (!UpdateEntry(updatedLanguage))
            {
                updatedLanguage = null;
                return(false);
            }

            UpdateResourceTableEntries();
            return(true);
        }