public void Show(UIView owner, ScreenController controller) { _doneButton.SetTitle(DoneTitle, UIControlState.Normal); _doneButton.SetTitleColor(UIColor.DarkTextColor, UIControlState.Normal); _cancelButton.SetTitle(CancelTitle, UIControlState.Normal); _cancelButton.SetTitleColor(UIColor.DarkTextColor, UIControlState.Normal); float titleBarHeight = 40; float margin = 10; var doneButtonSize = new SizeF(71, 30); var cancelButtonSize = new SizeF(71, 30); var layoutSize = new SizeF(owner.Frame.Width, _datePicker.Frame.Height + titleBarHeight); var actionSheetFrame = new RectangleF(0, owner.Frame.Height - layoutSize.Height , layoutSize.Width, layoutSize.Height); _layout.Frame = actionSheetFrame; _datePicker.Frame = new RectangleF(_datePicker.Frame.X, titleBarHeight, layoutSize.Width, _datePicker.Frame.Height); _titleLabel.Frame = new RectangleF(margin, 4, owner.Frame.Width - doneButtonSize.Width - cancelButtonSize.Width - 5 * margin, 35); _cancelButton.SizeToFit(); _doneButton.SizeToFit(); _cancelButton.Frame = new RectangleF(layoutSize.Width - doneButtonSize.Width - cancelButtonSize.Width - margin, 7, cancelButtonSize.Width, cancelButtonSize.Height); _cancelButton.TouchUpInside += (object sender, EventArgs e) => { if (Click != null) Click(this, new UIButtonEventArgs(1)); Close(); }; _doneButton.Frame = new RectangleF(layoutSize.Width - doneButtonSize.Width - margin, 7, doneButtonSize.Width, doneButtonSize.Height); _doneButton.TouchUpInside += (object sender, EventArgs e) => { if (Click != null) Click(this, new UIButtonEventArgs(0)); Close(); }; ScreenController.HackFieldForDateTimePicker.InputView = _layout; owner.AddSubview(ScreenController.HackFieldForDateTimePicker); ScreenController.HackFieldForDateTimePicker.BecomeFirstResponder(); }
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 = ValueStackContext.Current.CreateValueStack (_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); } } var newController = BusinessProcessContext.Current.CreateScreenController (controllerName); ValueStack.Push ("controller", newController); screenName = newController.GetView (screenName); TabOrderManager.Create (this); IStyleSheet styleSheet = StyleSheetContext.Current.CreateStyleSheet (); Screen scr = (Screen)BusinessProcessContext.Current.CreateScreenFactory ().CreateScreen (screenName, ValueStack, newController, styleSheet); if (CurrentScreen != null) ((IDisposable)CurrentScreen.Screen).Dispose (); CurrentScreen = ControlsContext.Current.CreateScreenData (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 { ControlsContext.Current.ActionHandlerIsBusy = false; ControlsContext.Current.ActionHandlerExIsBusy = false; Busy = false; } return true; }
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); }
public bool OpenScreen(String screenName , string controllerName, Dictionary <String , object> parameters = null , bool isBackCommand = false , bool isRefresh = false) { IDisposable rootControl = null; try { Busy = true; LogManager.Logger.ScreenOpening(screenName, controllerName, parameters); _back = null; _forward = null; ValueStack = ValueStackContext.Current.CreateValueStack(_exceptionHandler); ValueStack.Push("common", CommonData); ValueStack.Push("context", this); ValueStack.Push("dao", Dal.Dao); ValueStack.Push("isTablet", UIDevice.CurrentDevice.Model.Contains("iPad")); foreach (var variable in GlobalVariables) { ValueStack.Push(variable.Key, variable.Value); } if (parameters != null) { foreach (var item in parameters) { ValueStack.Push(item.Key, item.Value); } } IScreenController newController = BusinessProcessContext.Current.CreateScreenController(controllerName); ValueStack.SetCurrentController(newController); ValueStack.Push("controller", newController); screenName = newController.GetView(screenName); TabOrderManager.Create(this); var scr = (Screen) BusinessProcessContext.Current.CreateScreenFactory() .CreateScreen(screenName, ValueStack, newController, null); rootControl = RootControl; CurrentScreen = ControlsContext.Current.CreateScreenData(screenName, controllerName, scr); var viewController = new ScreenController(scr.View); if (!isRefresh) { _controller.SetViewControllers(new[] { _controller.TopViewController }, false); if (!isBackCommand) { _controller.PushViewController(viewController, true); } else { _controller.SetViewControllers(new[] { viewController, _controller.TopViewController }, false); _controller.PopViewControllerAnimated(true); } } else { _controller.PopViewControllerAnimated(false); _controller.PushViewController(viewController, false); } } catch (Exception ex) { HandleException(ex); } finally { LogManager.Logger.ScreenOpened(); if (rootControl != null) { rootControl.Dispose(); } GC.Collect(); ControlsContext.Current.ActionHandlerLocker.Release(); Busy = false; } return(true); }
public bool OpenScreen(String screenName , string controllerName, Dictionary<String , object> parameters = null , bool isBackCommand = false , bool isRefresh = false) { IDisposable rootControl = null; try { Busy = true; LogManager.Logger.ScreenOpening(screenName, controllerName, parameters); _back = null; _forward = null; ValueStack = ValueStackContext.Current.CreateValueStack(_exceptionHandler); ValueStack.Push("common", CommonData); ValueStack.Push("context", this); ValueStack.Push("dao", Dal.Dao); ValueStack.Push("isTablet", UIDevice.CurrentDevice.Model.Contains("iPad")); foreach (var variable in GlobalVariables) ValueStack.Push(variable.Key, variable.Value); if (parameters != null) { foreach (var item in parameters) { ValueStack.Push(item.Key, item.Value); } } IScreenController newController = BusinessProcessContext.Current.CreateScreenController(controllerName); ValueStack.SetCurrentController(newController); ValueStack.Push("controller", newController); screenName = newController.GetView(screenName); TabOrderManager.Create(this); var scr = (Screen) BusinessProcessContext.Current.CreateScreenFactory() .CreateScreen(screenName, ValueStack, newController, null); rootControl = RootControl; CurrentScreen = ControlsContext.Current.CreateScreenData(screenName, controllerName, scr); var viewController = new ScreenController(scr.View); if (!isRefresh) { _controller.SetViewControllers(new[] { _controller.TopViewController }, false); if (!isBackCommand) { _controller.PushViewController(viewController, true); } else { _controller.SetViewControllers(new[] { viewController, _controller.TopViewController }, false); _controller.PopViewControllerAnimated(true); } } else { _controller.PopViewControllerAnimated(false); _controller.PushViewController(viewController, false); } } catch (Exception ex) { HandleException(ex); } finally { LogManager.Logger.ScreenOpened(); if (rootControl != null) rootControl.Dispose(); GC.Collect(); ControlsContext.Current.ActionHandlerLocker.Release(); Busy = false; } return true; }