Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 KB | None | 0 0
  1.     public static void NavigateToNode(UITabBarController tabBar, Node node)
  2.         {
  3.             if (node.TumorId != AppDelegate.PickedTumor.Id)
  4.             {
  5.                 FillNode(node);
  6.                 PickedTumor = node.Tumor;
  7.             }
  8.  
  9.             ScrollingFlowchartViewController backup;
  10.             int tabId;
  11.             switch (node.NodeType)
  12.             {
  13.                 case NodeTypes.CareProgramCalculator:
  14.                 case NodeTypes.CareProgram:
  15.                     tabId = 4;
  16.                     backup = CareProgramViewController;
  17.                     break;
  18.                 default:
  19.                     tabId = 0;
  20.                     backup = CareFlowViewController;
  21.                     break;
  22.             }
  23.    
  24.             var nvc = tabBar.ViewControllers [tabId] as UINavigationController;
  25.             var sfvc = nvc.TopViewController as ScrollingFlowchartViewController ?? backup;
  26.  
  27.             if (node.TumorId != AppDelegate.PickedTumor.Id)
  28.             {
  29.                 AppDelegate.FillNode(node);
  30.                 AppDelegate.PickedTumor = node.Tumor;
  31.             }
  32.  
  33.             sfvc.source.SelectedNode = node;
  34.             sfvc.SetupFlowChart();
  35.             sfvc.SnapToSection(sfvc.source.GetTreeLevel(node), true);
  36.             tabBar.SelectedIndex = tabId;
  37.  
  38.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement