コード例 #1
0
        private void ProcessControl(MobileContentPage page, MobileContentScreen screen, BaseControl control)
        {
            //create control
            //View

            //initalize controls

            IView view = GetView(page, screen, control);

            ViewHelper.SetupView(page, screen, control, view);

            view.Init();

            this.Content = view.GetView();
        }
コード例 #2
0
ファイル: MobilePage.cs プロジェクト: dolani/CodeTorch
        public static IMobilePage    GetPage(string pageName)
        {
            IMobilePage retVal = null;

            MobileScreen screen = MobileScreen.GetByName(pageName);

            switch (screen.Type.ToLower())
            {
            case "mobilecontent":
                retVal = new MobileContentPage(screen);
                break;

            case "mobiletabbed":
                retVal = new MobileTabbedPage(screen);
                break;

            case "mobilenavigation":
                Page root = GetPage(((MobileNavigationScreen)screen).GetRootScreen()).GetPage();
                retVal = new MobileNavigationPage(screen, root);
                break;
            }

            if (retVal != null)
            {
                string loginScreen = Configuration.GetInstance().App.LoginScreen;

                if (!String.IsNullOrEmpty(loginScreen))
                {
                    if (retVal.Screen != null)
                    {
                        if (retVal.Screen.RequireAuthentication)
                        {
                            UserIdentityService identity = UserIdentityService.GetInstance();
                            string userName = identity.IdentityProvider.GetUserName();

                            if (String.IsNullOrEmpty(userName))
                            {
                                retVal = GetPage(loginScreen);
                            }
                        }
                    }
                }
            }

            return(retVal);
        }