예제 #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
파일: 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);
        }