/// <summary>
        /// Saves this instance to the resource file.
        /// </summary>
        /// <param name="forceSortFileContent">if set to <c>true</c> to force sorting the file content.</param>
        /// <exception cref="IOException"></exception>
        /// <exception cref="UnauthorizedAccessException"></exception>
        public void Save(bool forceSortFileContent)
        {
            var configuration = _resourceManager.Configuration;

            if (forceSortFileContent || configuration.SortFileContentOnSave)
            {
                SortNodes(configuration.ResXSortingComparison);
            }

            _file.Save();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Saves this instance to the resource file.
        /// </summary>
        /// <exception cref="IOException"></exception>
        /// <exception cref="UnauthorizedAccessException"></exception>
        public void Save()
        {
            try
            {
                IsSaving = true;

                _file.Save(_document);

                Container.Container.OnProjectFileSaved(this, _file);
            }
            finally
            {
                IsSaving = false;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Saves this instance to the resource file.
        /// </summary>
        /// <param name="fileContentSorting">If a string comparison is specified, the file content will be sorted by the key.</param>
        /// <exception cref="IOException"></exception>
        /// <exception cref="UnauthorizedAccessException"></exception>
        public void Save(StringComparison?fileContentSorting)
        {
            if (fileContentSorting.HasValue)
            {
                if (SortNodes(fileContentSorting.Value))
                {
                    _file.Changed();

                    UpdateNodes(_file, DuplicateKeyHandling.Rename);

                    Container.OnItemOrderChanged(this);
                }
            }

            _file.Save();
        }