예제 #1
0
        public override string?Render()
        {
            Content = ChildNode?.Render();
            Content = Content != null ? $"<h3{GetAttributes()}>{Content}</h3>" : $"<h3{GetAttributes()}></h3>";

            return(Content + SiblingNode?.Render());
        }
예제 #2
0
        public override string?Render()
        {
            if (!IsChildAllowed(ChildNode?.GetType()))
            {
                throw new InvalidOperationException($"Child of type {ChildNode?.GetType()} is not allowed");
            }

            if (!IsSiblingAllowed(SiblingNode?.GetType()))
            {
                throw new InvalidOperationException($"Sibling of type {SiblingNode?.GetType()} is not allowed");
            }

            Content = ChildNode?.Render();
            Content = Content != null ? $"<head>{Content}</head>" : "<head></head>";

            return(Content + SiblingNode?.Render());
        }