Example #1
0
        /// <summary>
        ///     Merges otherSection into this, adding new keys if they don't exists
        ///     or overwriting values if the key already exists.
        /// Comments get appended.
        /// </summary>
        /// <remarks>
        ///     Comments are also merged but they are always added, not overwritten.
        /// </remarks>
        /// <param name="toMergeSection"></param>
        public void Merge(SectionData toMergeSection)
        {
            foreach (var comment in toMergeSection.LeadingComments)
            {
                LeadingComments.Add(comment);
            }

            Keys.Merge(toMergeSection.Keys);

            foreach (var comment in toMergeSection.TrailingComments)
            {
                TrailingComments.Add(comment);
            }
        }
        /// <summary>
        ///     Merges otherSection into this, adding new keys if they don't exists
        ///     or overwriting values if the key already exists.
        ///     Comments get appended.
        /// </summary>
        /// <remarks>
        ///     Comments are also merged but they are always added, not overwritten.
        /// </remarks>
        /// <param name="toMergeSection"></param>
        public void Merge(SectionData toMergeSection)
        {
#pragma warning disable CS0618 // Typ oder Element ist veraltet
            foreach (var comment in toMergeSection.LeadingComments)
#pragma warning restore CS0618 // Typ oder Element ist veraltet
#pragma warning disable CS0618 // Typ oder Element ist veraltet
            {
                LeadingComments.Add(comment);
            }
#pragma warning restore CS0618 // Typ oder Element ist veraltet

            Keys.Merge(toMergeSection.Keys);

#pragma warning disable CS0618 // Typ oder Element ist veraltet
            foreach (var comment in toMergeSection.TrailingComments)
#pragma warning restore CS0618 // Typ oder Element ist veraltet
#pragma warning disable CS0618 // Typ oder Element ist veraltet
            {
                TrailingComments.Add(comment);
            }
#pragma warning restore CS0618 // Typ oder Element ist veraltet
        }
Example #3
0
        /// <summary>
        ///     Merges otherSection into this, adding new keys if they don't exists
        ///     or overwriting values if the key already exists.
        /// Comments get appended.
        /// </summary>
        /// <remarks>
        ///     Comments are also merged but they are always added, not overwritten.
        /// </remarks>
        /// <param name="toMergeSection"></param>
        public void Merge(SectionData toMergeSection)
        {
#pragma warning disable CS0618 // Type or member is obsolete
            foreach (var comment in toMergeSection.LeadingComments)
#pragma warning restore CS0618 // Type or member is obsolete
            {
#pragma warning disable CS0618 // Type or member is obsolete
                LeadingComments.Add(comment);
#pragma warning restore CS0618 // Type or member is obsolete
            }

            Keys.Merge(toMergeSection.Keys);

#pragma warning disable CS0618 // Type or member is obsolete
            foreach (var comment in toMergeSection.TrailingComments)
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
            {
                TrailingComments.Add(comment);
            }
#pragma warning restore CS0618 // Type or member is obsolete
        }