Ejemplo n.º 1
0
 public Enumerator(ContainerInline container) : this()
 {
     if (container == null)
     {
         ThrowHelper.ArgumentNullException(nameof(container));
     }
     this.container = container;
     currentChild   = nextChild = container.FirstChild;
 }
Ejemplo n.º 2
0
        public static string ToMarkdownString(this Markdig.Syntax.Inlines.ContainerInline inlines)
        {
            var str = string.Empty;

            foreach (var inline in inlines)
            {
                str += inline.ToMarkdownString();
            }
            return(str);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Embraces this instance by the specified container.
        /// </summary>
        /// <param name="container">The container to use to embrace this instance.</param>
        /// <exception cref="ArgumentNullException">If the container is null</exception>
        public void EmbraceChildrenBy(ContainerInline container)
        {
            if (container == null)
            {
                ThrowHelper.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);
        }
Ejemplo n.º 4
0
 public Enumerator(ContainerInline container) : this()
 {
     this.container = container ?? throw new ArgumentNullException(nameof(container));
     currentChild   = nextChild = container.FirstChild;
 }