Ejemplo n.º 1
0
 /// <summary>
 ///     Inserts another rope into this rope.
 ///     Runs in O(lg N + lg M), plus a per-node cost as if <c>newElements.Clone()</c> was called.
 /// </summary>
 /// <exception cref="ArgumentNullException">newElements is null.</exception>
 /// <exception cref="ArgumentOutOfRangeException">index or length is outside the valid range.</exception>
 public void InsertRange(int index, Rope <T> newElements)
 {
     if (index < 0 || index > Length)
     {
         throw new ArgumentOutOfRangeException("index", index,
                                               "0 <= index <= " + Length.ToString(CultureInfo.InvariantCulture));
     }
     if (newElements == null)
     {
         throw new ArgumentNullException("newElements");
     }
     newElements.root.Publish();
     root = root.Insert(index, newElements.root);
     OnChanged();
 }