internal static void SetupView(IMobilePage page, MobileScreen screen, BaseControl control, IView view) { if (!String.IsNullOrEmpty(control.Name)) { if (page.Elements.ContainsKey(control.Name)) { throw new Exception(String.Format("Screen {0} - cannot have controls with duplicate names - {1}", screen.Name, control.Name)); } page.Elements.Add(control.Name, view.GetView()); } }
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); }
public static List <ScreenDataCommandParameter> GetPopulatedCommandParameters(string DataCommandName, IMobilePage page, List <ScreenDataCommand> datacommands) { string ErrorFormat = "Invalid {0} propery for Data Command {1} Parameter {2} - {3}"; List <ScreenDataCommandParameter> parameters = new List <ScreenDataCommandParameter>(); ScreenDataCommand screenCommand = ScreenDataCommand.GetDataCommand(datacommands, DataCommandName); if ((screenCommand != null) && (screenCommand.Parameters != null)) { foreach (ScreenDataCommandParameter existingP in screenCommand.Parameters) { ScreenDataCommandParameter p = existingP.Clone(); try { p.Value = Common.GetParameterInputValue(page, p); parameters.Add(p); } catch (Exception ex) { throw new Exception( String.Format(ErrorFormat, "Value", DataCommandName, p.Name, ex.Message), ex); } } } return(parameters); }
public static List <ScreenDataCommandParameter> GetPopulatedCommandParameters(string DataCommandName, IMobilePage page) { return(GetPopulatedCommandParameters(DataCommandName, page, page.Screen.DataCommands)); }
internal static void DisplayErrorAlert(IMobilePage mobilepage, string message) { Page page = mobilepage.GetPage(); page.DisplayAlert("Error", message, "OK"); }