コード例 #1
0
        /// <summary>
        /// Creates a normalized <see cref="IniContainer"/> using the provided one.
        /// </summary>
        /// <param name="normalizer">The normalizer to use</param>
        /// <param name="source">The container to normalize</param>
        /// <returns>The new container with the normalization result</returns>
        public static IniContainer Normalize(this IIniNormalizer normalizer, IniContainer source)
        {
            if (normalizer == null)
            {
                throw new ArgumentNullException(nameof(normalizer));
            }

            var destination = new IniContainer();

            normalizer.NormalizeInto(source, destination);

            return(destination);
        }
コード例 #2
0
        /// <summary>
        /// Normalizes the collection of <see cref="IniProperty"/>.
        /// </summary>
        /// <param name="normalizer">The normalizer to use</param>
        /// <param name="source">The source to normalize</param>
        /// <returns>The normalized collection</returns>
        public static ICollection <IniProperty> Normalize(
            this IIniNormalizer normalizer, IEnumerable <IniProperty> source)
        {
            if (normalizer == null)
            {
                throw new ArgumentNullException(nameof(normalizer));
            }

            var destination = new List <IniProperty>();

            normalizer.NormalizeInto(source, destination);

            return(destination);
        }
コード例 #3
0
        /// <summary>
        /// Normalizes the collection of <see cref="IniSection"/>.
        /// </summary>
        /// <param name="normalizer">The normalizer to use</param>
        /// <param name="source">The source to normalize</param>
        /// <returns>The normalized collection</returns>
        public static ICollection <IniSection> Normalize(
            this IIniNormalizer normalizer, IReadOnlyCollection <IniSection> source)
        {
            if (normalizer == null)
            {
                throw new ArgumentNullException(nameof(normalizer));
            }
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            var destination = new List <IniSection>(source.Count);

            normalizer.NormalizeInto(source, destination);

            return(destination);
        }