private void IfConditionalCommentHandler(MarkupParsingContext context,
HtmlConditionalComment htmlConditionalComment)
{
_currentNodeType = HtmlNodeType.IfConditionalComment;
HtmlConditionalCommentType htmlConditionalCommentType = htmlConditionalComment.Type;
string startPart;
string endPart;
switch (htmlConditionalCommentType)
{
case HtmlConditionalCommentType.Hidden:
startPart = "<!--[if ";
endPart = "]>";
break;
case HtmlConditionalCommentType.RevealedValidating:
startPart = "<!--[if ";
endPart = "]><!-->";
break;
case HtmlConditionalCommentType.RevealedValidatingSimplified:
startPart = "<!--[if ";
endPart = "]>-->";
break;
case HtmlConditionalCommentType.Revealed:
startPart = "<![if ";
endPart = "]>";
break;
default:
throw new NotSupportedException();
}
_buffer.Add(startPart);
_buffer.Add(htmlConditionalComment.Expression);
_buffer.Add(endPart);
}