Ejemplo n.º 1
0
 private void Logon(bool clearCache, String message = null)
 {
     if (_logonController == null)
     {
         _logonController = new LogonController(clearCache, Settings, LoadApplication, message);
     }
     else
     {
         _logonController.UpdateMessage(message);
     }
     _controller.SetViewControllers(new UIViewController[] { _logonController }, false);
 }
Ejemplo n.º 2
0
        public bool OpenScreen(String screenName
                               , string controllerName, Dictionary <String
                                                                    , object> parameters = null
                               , bool isBackCommand = false
                               , bool isRefresh     = false)
        {
            try {
                Busy = true;

                _back    = null;
                _forward = null;

                ValueStack = new ValueStack.ValueStack(_exceptionHandler);
                ValueStack.Push("common", _commonData);
                ValueStack.Push("context", this);
                ValueStack.Push("dao", DAL.DAO);

                foreach (var variable in GlobalVariables)
                {
                    ValueStack.Push(variable.Key, variable.Value);
                }

                if (parameters != null)
                {
                    foreach (KeyValuePair <String, object> item in parameters)
                    {
                        ValueStack.Push(item.Key, item.Value);
                    }
                }

                Controllers.ScreenController newController =
                    ControllerFactory.CreateInstance().CreateController <Controllers.ScreenController> (controllerName);
                ValueStack.Push("controller", newController);
                screenName = newController.GetView(screenName);

                TabOrderManager.Create(this);

                Screen scr = (Screen)Factory.ScreenFactory.CreateInstance().CreateScreen <IOSStyleSheet> (screenName, ValueStack, newController);

                if (CurrentScreen != null)
                {
                    ((IDisposable)CurrentScreen.Screen).Dispose();
                }
                CurrentScreen = new ScreenData(screenName, controllerName, scr);

                ScreenController viewController = new ScreenController(scr.View);

                if (!isRefresh)
                {
                    _controller.SetViewControllers(new UIViewController[] {
                        _controller.TopViewController
                    }, false);

                    if (!isBackCommand)
                    {
                        _controller.PushViewController(viewController, true);
                    }
                    else
                    {
                        _controller.SetViewControllers(new UIViewController[] {
                            viewController,
                            _controller.TopViewController
                        }, false);
                        _controller.PopViewControllerAnimated(true);
                    }
                }
                else
                {
                    _controller.PopViewControllerAnimated(false);
                    _controller.PushViewController(viewController, false);
                }
            } catch (Exception ex) {
                HandleException(ex);
            } finally {
                ActionHandler.Busy   = false;
                ActionHandlerEx.Busy = false;
                Busy = false;
            }
            return(true);
        }