/// <summary>
        ///
        /// </summary>
        /// <param name="param"></param>
        public void UpdateScreenTransitionView(object param)
        {
            this.mLogger.Debug("[UpdateScreenTransitionView] - IN");
            this.mLogger.Debug("[UpdateScreenTransitionView] Count=" + mScreenTransitionEventList.Count);
            var viewEventList = new List <UpdateViewIntentParameter> ();

            var copy = new List <ScreenEventItem> (mScreenTransitionEventList);

            mScreenTransitionEventList.Clear();

            ScreenEventItem lastItem = null;

            foreach (var item in copy)
            {
                if (mScreenStack.Count == 1 &&
                    !item.PushEventFlag &&
                    lastItem == null)
                {
                    lastItem = item;
                }
                else if (mScreenStack.Count == 1 &&
                         lastItem != null &&
                         lastItem.ScreenName == item.ScreenName)
                {
                    // set
                    viewEventList.Add(new UpdateViewIntentParameter {
                        ScreenName = item.ScreenName,
                        UpdateType = UpdateType.SET
                    });

                    lastItem = null;
                }
                else
                {
                    if (lastItem != null)
                    {
                        if (lastItem.PushEventFlag)
                        {
                            // push
                            viewEventList.Add(new UpdateViewIntentParameter {
                                ScreenName = lastItem.ScreenName,
                                UpdateType = UpdateType.PUSH
                            });

                            mScreenStack.Push(new ScreenItem(item.ScreenName));
                        }
                        else
                        {
                            // pop
                            viewEventList.Add(new UpdateViewIntentParameter {
                                ScreenName = lastItem.ScreenName,
                                UpdateType = UpdateType.POP
                            });
                            mScreenStack.Pop();
                        }
                    }

                    if (item.PushEventFlag)
                    {
                        // push
                        var viewEvent = new UpdateViewIntentParameter {
                            ScreenName = item.ScreenName,
                            UpdateType = UpdateType.PUSH
                        };

                        if (mScreenStack.Count == 0)
                        {
                            viewEvent.UpdateType = UpdateType.SET;
                        }

                        viewEventList.Add(viewEvent);
                        mScreenStack.Push(new ScreenItem(item.ScreenName));
                    }
                    else
                    {
                        // pop
                        viewEventList.Add(new UpdateViewIntentParameter {
                            ScreenName = item.ScreenName,
                            UpdateType = UpdateType.POP
                        });
                        mScreenStack.Pop();
                    }

                    lastItem = null;
                }
            }

            // 画面表示の切り替えがある場合のみ、UpdateViewメッセージを送信する
            if (viewEventList.Count > 0)
            {
                var peekItem = mScreenStack.Peek();

                var nextScreen = "";
                if (peekItem != null)
                {
                    this.mLogger.Debug("[UpdateScreenTransitionView] - スタック内の次の要素={@ScreenName}", peekItem.mScreenName);
                    nextScreen = peekItem.mScreenName;
                }
                this.DumpBackStack();

                mIntentManager.AddIntent(ServiceType.FrontendIpc, "UpdateView", new UpdateViewResponse {
                    ViewEventList  = viewEventList,
                    Parameter      = param,
                    NextScreenName = nextScreen
                });
            }
        }
Exemple #2
0
        public void UpdateScreenTransitionView(object param)
        {
            Console.WriteLine("[ScreenManager][UpdateScreenTransitionView] - IN");
            Console.WriteLine("   Count=" + mScreenTransitionEventList.Count);
            var viewEventList = new List <UpdateViewIntentParameter>();

            var copy = new List <ScreenEventItem>(mScreenTransitionEventList);

            mScreenTransitionEventList.Clear();

            ScreenEventItem lastItem = null;

            foreach (var item in copy)
            {
                if (mScreenStack.Count == 1 &&
                    !item.PushEventFlag &&
                    lastItem == null)
                {
                    lastItem = item;
                }
                else if (mScreenStack.Count == 1 &&
                         lastItem != null &&
                         lastItem.ScreenName == item.ScreenName)
                {
                    // set
                    viewEventList.Add(new UpdateViewIntentParameter
                    {
                        ScreenName = item.ScreenName,
                        UpdateType = UpdateType.SET
                    });

                    lastItem = null;
                }
                else
                {
                    if (lastItem != null)
                    {
                        if (lastItem.PushEventFlag)
                        {
                            // push
                            viewEventList.Add(new UpdateViewIntentParameter
                            {
                                ScreenName = lastItem.ScreenName,
                                UpdateType = UpdateType.PUSH
                            });

                            mScreenStack.Push(new ScreenItem());
                        }
                        else
                        {
                            // pop
                            viewEventList.Add(new UpdateViewIntentParameter
                            {
                                ScreenName = lastItem.ScreenName,
                                UpdateType = UpdateType.POP
                            });
                            mScreenStack.Pop();
                        }
                    }

                    if (item.PushEventFlag)
                    {
                        // push
                        var viewEvent = new UpdateViewIntentParameter
                        {
                            ScreenName = item.ScreenName,
                            UpdateType = UpdateType.PUSH
                        };

                        if (mScreenStack.Count == 0)
                        {
                            viewEvent.UpdateType = UpdateType.SET;
                        }

                        viewEventList.Add(viewEvent);
                        mScreenStack.Push(new ScreenItem());
                    }
                    else
                    {
                        // pop
                        viewEventList.Add(new UpdateViewIntentParameter
                        {
                            ScreenName = item.ScreenName,
                            UpdateType = UpdateType.POP
                        });
                        mScreenStack.Pop();
                    }

                    lastItem = null;
                }
            }

            // 画面表示の切り替えがある場合のみ、UpdateViewメッセージを送信する
            if (viewEventList.Count > 0)
            {
                mIntentManger.AddIntent(ServiceType.FrontendIpc, "UpdateView", new UpdateViewResponse
                {
                    ViewEventList = viewEventList,
                    Parameter     = param
                });
            }
        }