Example #1
0
 public Enumerator(ContainerInline container) : this()
 {
     if (container == null)
     {
         throw new ArgumentNullException(nameof(container));
     }
     this.container = container;
     currentChild   = nextChild = container.FirstChild;
 }
Example #2
0
        /// <summary>
        /// Embraces this instance by the specified container.
        /// </summary>
        /// <param name="container">The container to use to embrace this instance.</param>
        /// <exception cref="System.ArgumentNullException">If the container is null</exception>
        public void EmbraceChildrenBy(ContainerInline container)
        {
            if (container == null)
            {
                throw new ArgumentNullException(nameof(container));
            }
            var child = FirstChild;

            while (child != null)
            {
                var next = child.NextSibling;
                // TODO: optimize this
                child.Remove();
                container.AppendChild(child);
                child = next;
            }
            AppendChild(container);
        }