Catel.ReSharper.DictionaryWithKeyStringOfListOfTextRangeOrDocumentRangeExtensions.Merge C# (CSharp) Method

Merge() public static method

public static Merge ( this @this, Dictionary fields ) : void
@this this
fields Dictionary
return void
        public static void Merge(this Dictionary<string, List<DocumentRange>> @this, Dictionary<string, List<DocumentRange>> fields)
        {
            Argument.IsNotNull(() => @this);

            if (fields != null)
            {
                foreach (var fieldName in fields.Keys)
                {
                    List<DocumentRange> textRanges = fields[fieldName];
                    if (@this.ContainsKey(fieldName))
                    {
                        @this[fieldName].AddRange(textRanges);
                    }
                    else
                    {
                        @this.Add(fieldName, textRanges);
                    }
                }
            }
        }
DictionaryWithKeyStringOfListOfTextRangeOrDocumentRangeExtensions