Beispiel #1
0
        private static UISAnimationElement AnimationElement()
        {
            ExpectGrammar(Tag.Animation);
            UISAnimationElement e = ReadElementT(Tag.IDENTITY, v => new UISAnimationElement(v, false), AniCollect);

            Animation_Table.AddLast(e);
            return(e);

            //if (Expect(Tag.Animation))
            //{
            //    Word name = look as Word;
            //    UISAnimationElement aniE = new UISAnimationElement(name.Lexeme);
            //    if(Expect(Tag.Index))
            //    {
            //        aniE.IsMultiSelect = true;
            //        aniE.Indexs = indexs();
            //    }
            //    Expect(Tag.LINE_END);
            //    aniE.AddAllProperty(aniCollect());
            //    return aniE;
            //}
            //throw new ParseException(look as Word, "Animation element");
        }
Beispiel #2
0
        private static UISValue Motion()
        {
            UISAnimationElement result = null;

            if (Test(Tag.IDENTITY))
            {
                UISText ani = Word(typeof(Space));
                result = Animation_Table.FirstOrDefault(p => p.ElementName == ani.Text);
                if (result == null)
                {
                    ThrowError(new UISTargetAnimationNotExistException(ani.Text));                                 //读取Delay
                }
                if (' ' == (int)look.TokenTag)
                {
                    Move();
                    Word id = look as Word;
                    if (id.Lexeme != "delay")
                    {
                        ThrowError(new UISUnsupportPropertyException(id.Lexeme));
                    }
                    ExpectGrammar(Tag.IDENTITY);
                    ExpectGrammar(Tag.Equal);
                    TestGrammar(Tag.NUMBER);
                    return(new UISMotion(result, Expr() as UISNumber));
                }
                return(new UISMotion(result));
            }
            else if (ExpectGrammar(Tag.AnimationInline, Tag.Animation))
            {
                result = new UISAnimationElement($"INLINE_ANIMATION_{TEMP_ANIMATION_FLAG++}", true);
                result.AddProperty(Animation());
                return(new UISMotion(result));
            }

            return(ThrowError(new UISInlineAnimationException((look as Word).Lexeme)));
        }