Example #1
0
 /// <summary>Decreases the quote depth.</summary>
 /// <param name="context">the context</param>
 private void DecreaseDepth(AbstractCssContext context)
 {
     if (context.GetQuotesDepth() > 0)
     {
         context.SetQuotesDepth(context.GetQuotesDepth() - 1);
     }
 }
Example #2
0
        /// <summary>Resolves quotes.</summary>
        /// <param name="value">the value</param>
        /// <param name="context">the CSS context</param>
        /// <returns>the quote string</returns>
        public virtual String ResolveQuote(String value, AbstractCssContext context)
        {
            int depth = context.GetQuotesDepth();

            if (CommonCssConstants.OPEN_QUOTE.Equals(value))
            {
                IncreaseDepth(context);
                return(GetQuote(depth, openQuotes));
            }
            else
            {
                if (CommonCssConstants.CLOSE_QUOTE.Equals(value))
                {
                    DecreaseDepth(context);
                    return(GetQuote(depth - 1, closeQuotes));
                }
                else
                {
                    if (CommonCssConstants.NO_OPEN_QUOTE.Equals(value))
                    {
                        IncreaseDepth(context);
                        return(EMPTY_QUOTE);
                    }
                    else
                    {
                        if (CommonCssConstants.NO_CLOSE_QUOTE.Equals(value))
                        {
                            DecreaseDepth(context);
                            return(EMPTY_QUOTE);
                        }
                    }
                }
            }
            return(null);
        }
Example #3
0
 /// <summary>Increases the quote depth.</summary>
 /// <param name="context">the context</param>
 private void IncreaseDepth(AbstractCssContext context)
 {
     context.SetQuotesDepth(context.GetQuotesDepth() + 1);
 }