WebMarkupMin.Core.Parsers.HtmlParser.ParseIfConditionalComment C# (CSharp) Method

ParseIfConditionalComment() private method

Parses a If conditional comment
private ParseIfConditionalComment ( string expression, HtmlConditionalCommentType type ) : void
expression string Conditional expression
type HtmlConditionalCommentType Conditional comment type
return void
        private void ParseIfConditionalComment(string expression, HtmlConditionalCommentType type)
        {
            if (_conditionalCommentStack.Count > 0)
            {
                throw new MarkupParsingException(
                    Strings.ErrorMessage_NotClosedConditionalComment,
                    _innerContext.NodeCoordinates, _innerContext.GetSourceFragment());
            }

            string processedExpression = expression.Trim();

            _conditionalCommentStack.Push(new HtmlConditionalComment(expression, type));
            if (type == HtmlConditionalCommentType.Hidden || type == HtmlConditionalCommentType.Revealed)
            {
                _conditionalCommentOpened = true;
            }

            if (_handlers.IfConditionalComment != null)
            {
                _handlers.IfConditionalComment(_context, new HtmlConditionalComment(processedExpression, type));
            }
        }