public override void PerformAction(string command, string[] arguments) { base.PerformAction(command, arguments); switch (command) { case PrivateGeneralConfig.App_URL_Commands_Goto: { // make sure the argument is for us (and it wants more than just our root page) if (arguments[0] == Command_Keyword( ) && arguments.Length > 1) { // if they want a "read" page, we support that. if (arguments[1] == PrivateGeneralConfig.App_URL_Page_Read) { if (RockLaunchData.Instance.Data.NoteDB.SeriesList.Count > 0) { // since we're switching to the read notes VC, pop to the main page root and // remove it, because we dont' want back history (where would they go back to?) ParentViewController.ClearViewControllerStack( ); NoteController.NoteName = RockLaunchData.Instance.Data.NoteDB.SeriesList[0].Messages[0].Name; NoteController.NoteUrl = RockLaunchData.Instance.Data.NoteDB.SeriesList[0].Messages[0].NoteUrl; ParentViewController.PushViewController(NoteController, false); } } } break; } } }
/// <summary> /// The root function to call when changing view controllers within a task. If changing in code, /// directly call this from the view controller. If using a storyboard, hook the segue to TaskTransition /// in ContainerViewController.cs, which will cause this function to be called. /// </summary> /// <param name="sourceViewController">Source view controller.</param> /// <param name="destinationViewController">Destination view controller.</param> public void PerformSegue(UIViewController sourceViewController, UIViewController destinationViewController, bool animated = true) { // take this opportunity to give the presenting view controller a pointer to the active task // so it can receive callbacks. TaskUIViewController viewController = destinationViewController as TaskUIViewController; if (viewController == null) { throw new InvalidCastException("View Controllers used by Activities must be of type TaskUIViewController"); } ParentViewController.PushViewController(destinationViewController, animated); }
public override void PerformAction(string command, string[] arguments) { base.PerformAction(command, arguments); switch (command) { // is this a goto command? case PrivateGeneralConfig.App_URL_Commands_Goto: { // make sure the argument is for us if (arguments[0] == Command_Keyword( ) && arguments.Length > 1) { // check for groupfinder, because we support that one. if (PrivateGeneralConfig.App_URL_Page_GroupFinder == arguments[1]) { // since we're switching to the read notes VC, pop to the main page root and // remove it, because we dont' want back history (where would they go back to?) ParentViewController.ClearViewControllerStack( ); // create and launch the group finder. It's fine to create it here because we always dynamically create this controller. TaskUIViewController viewController = Storyboard.InstantiateViewController("GroupFinderViewController") as TaskUIViewController; ParentViewController.PushViewController(viewController, false); } else { List <ConnectLink> engagedEntries = ConnectLink.BuildGetEngagedList( ); ConnectLink connectLink = engagedEntries.Where(e => e.Command_Keyword == arguments[1]).SingleOrDefault( ); if (connectLink != null) { // clear out the stack and push the main connect page onto the stack ParentViewController.ClearViewControllerStack( ); ParentViewController.PushViewController(MainPageVC, false); // now go to the requested URL (and do not animate it--that could allow a race condition if this action is called rapidly TaskWebViewController.HandleUrl(false, true, connectLink.Url, this, MainPageVC, false, false, false, false); } } } break; } } }