示例#1
0
        public static CSSCharsetRule ConvertToCSSCharsetRule(AntlrModel.CharSet charset)
        {
            var charsetRule = new CSSCharsetRule();

            charsetRule.encoding = new Regex(@"['|""]").Replace(charset.Name, "");
            charsetRule.cssText  = charset.Serialize();
            return(charsetRule);
        }
示例#2
0
        /// <summary>
        /// Creates a new @charset-rule from the given source.
        /// </summary>
        /// <param name="source">The token iterator.</param>
        /// <returns>The @charset-rule.</returns>
        CSSCharsetRule CreateCharsetRule(IEnumerator <CssToken> source)
        {
            var charset = new CSSCharsetRule();

            charset.ParentStyleSheet = sheet;

            if (source.Current.Type == CssTokenType.String)
            {
                charset.Encoding = ((CssStringToken)source.Current).Data;
            }

            SkipToNextSemicolon(source);
            return(charset);
        }