Ejemplo n.º 1
0
            public PageState <TPage> ReducePop(
                PageState <TPage> pageState,
                SceneState <TScene> sceneState,
                PopAction action
                )
            {
                // don't remove last page
                if (pageState.Stack.Count > 1)
                {
                    pageState.Stack.RemoveLast();
                }

                pageState.SetStateChanged();

                ReduceAdjust(pageState, sceneState);
                return(pageState);
            }
Ejemplo n.º 2
0
 internal void Add(PopAction <TViewModel> action)
 {
     _pops.Add(action);
 }
Ejemplo n.º 3
0
        Reaction operation()
        {
            if (LookAhead(EngageToken.KW_POP))
            {
                match(EngageToken.KW_POP);
                string    name = consumeText(EngageToken.ID);
                PopAction op   = new PopAction();
                op.Name = name;
                return(op);
            }
            else if (LookAhead(EngageToken.KW_POP_STAR_))
            {
                match(EngageToken.KW_POP_STAR_);
                string        name = consumeText(EngageToken.ID);
                PopStarAction op   = new PopStarAction();
                op.Name = name;
                return(op);
            }
            else if (LookAhead(EngageToken.KW_POP_HASH_))
            {
                match(EngageToken.KW_POP_HASH_);
                string        name = consumeText(EngageToken.ID);
                PopHashAction op   = new PopHashAction();
                op.Name = name;
                return(op);
            }
            else if (LookAhead(EngageToken.KW_AWAIT, EngageToken.LPAREN))
            {
                match(EngageToken.KW_AWAIT);
                match(EngageToken.LPAREN);
                string name = consumeText(EngageToken.ID);
                match(EngageToken.KW_UPON);
                string extraContext = consumeText(EngageToken.ID);
                match(EngageToken.RPAREN);
                string tmpContext = "";
                if (LookAhead(EngageToken.KW_WITH))
                {
                    match(EngageToken.KW_WITH);
                    tmpContext = consumeText(EngageToken.ID);
                }

                AwaitAction op = new AwaitAction();
                op.Name         = name;
                op.ExtraContext = extraContext;
                op.TmpContext   = tmpContext;
                return(op);
            }
            else if (LookAhead(EngageToken.KW_AWAIT))
            {
                match(EngageToken.KW_AWAIT);
                string name       = consumeText(EngageToken.ID);
                string tmpContext = "";
                if (LookAhead(EngageToken.KW_WITH))
                {
                    match(EngageToken.KW_WITH);
                    tmpContext = consumeText(EngageToken.ID);
                }

                AwaitAction op = new AwaitAction();
                op.Name         = name;
                op.ExtraContext = "";
                op.TmpContext   = tmpContext;
                return(op);
            }
            else if (LookAhead(EngageToken.KW_AWAIT_STAR_))
            {
                match(EngageToken.KW_AWAIT_STAR_);
                string name       = consumeText(EngageToken.ID);
                string tmpContext = "";
                if (LookAhead(EngageToken.KW_WITH))
                {
                    match(EngageToken.KW_WITH);
                    tmpContext = consumeText(EngageToken.ID);
                }

                AwaitStarAction op = new AwaitStarAction();
                op.Name       = name;
                op.TmpContext = tmpContext;
                return(op);
            }
            else if (LookAhead(EngageToken.KW_TEAR))
            {
                match(EngageToken.KW_TEAR);
                string     name = consumeText(EngageToken.ID);
                TearAction op   = new TearAction();
                op.Name = name;
                return(op);
            }
            else
            {
                fail("Expected operation");
                return(null);
            }
        }