Пример #1
0
        /// <summary>
        /// Creates a new keyframe-rule from the given source.
        /// </summary>
        /// <param name="source">The token iterator.</param>
        /// <returns>The keyframe-rule.</returns>
        CSSKeyframeRule CreateKeyframeRule(IEnumerator<CssToken> source)
        {
            var keyframe = new CSSKeyframeRule();
            keyframe.ParentStyleSheet = sheet;
            keyframe.ParentRule = CurrentRule;
            open.Push(keyframe);

            do
            {
                if (source.Current.Type == CssTokenType.CurlyBracketOpen)
                {
                    if (SkipToNextNonWhitespace(source))
                    {
                        var tokens = LimitToCurrentBlock(source);
                        AppendDeclarations(tokens.GetEnumerator(), keyframe.Style.List);
                    }

                    break;
                }

                buffer.Append(source.Current.ToString());
            }
            while (source.MoveNext());

            keyframe.KeyText = buffer.ToString();
            buffer.Clear();
            open.Pop();
            return keyframe;
        }
Пример #2
0
 internal void AddRule(CSSKeyframeRule rule)
 {
     _rules.List.Add(rule);
 }