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

            return(Content + SiblingNode?.Render());
        }
示例#2
0
文件: Html.cs 项目: hevey/Sharpie
        public override string?Render()
        {
            if (!IsChildAllowed(ChildNode?.GetType()))
            {
                throw new InvalidOperationException($"Child of type {ChildNode?.GetType()} is not allowed");
            }

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

            return(Content);
        }
示例#3
0
文件: Body.cs 项目: hevey/Sharpie
        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 ? $"<body>{Content}</body>" : "<body></body>";

            return(Content);
        }