Пример #1
0
            /// <summary>
            /// If there are subsections in the hierarchy, navigate to those
            /// ASSUMES there are _never_ Categories hanging off the root in the hierarchy
            /// </summary>
            public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
            {
                Console.WriteLine("MAIN TableViewDelegate.RowSelected: Label={0}", list[indexPath.Row].Name);

                SectionViewController uivc = new SectionViewController(mvc);

                uivc.Title    = list[indexPath.Row].Name;
                uivc.Sections = mvc.Classes[indexPath.Row].Sections;
                if (uivc.Sections.Count == 0)
                {
                    Console.WriteLine("Doesn't support 'words' hanging off the root RogetClass elements");
                }
                else
                {
                    Console.WriteLine("  thesaurus count: " + uivc.Sections.Count);
                    mvc.NavigationController.PushViewController(uivc, true);
                }
            }
Пример #2
0
            /// <summary>
            /// A section was touched. Either show the next level of of Sections
            /// or load a different view for Categories
            /// </summary>
            public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
            {
                Console.WriteLine("SECTION TableViewDelegate.RowSelected: Label={0}", list[indexPath.Row].Name);

                if (svc.Sections[indexPath.Row].Sections.Count == 0)
                {                       // show words
                    Console.WriteLine("  show words {0} to {1}", list[indexPath.Row].StartCategory, list[indexPath.Row].EndCategory);
                    CategoryViewController secvc = new CategoryViewController(mvc, list[indexPath.Row].StartCategory, list[indexPath.Row].EndCategory);
                    secvc.Title = list[indexPath.Row].Name;
                    mvc.NavigationController.PushViewController(secvc, true);
                }
                else
                {                       // show more sections (more hierarchy)
                    SectionViewController uivc = new SectionViewController(mvc);
                    uivc.Title    = list[indexPath.Row].Name;
                    uivc.Sections = svc.Sections[indexPath.Row].Sections;
                    Console.WriteLine("  thesaurus count: " + uivc.Sections.Count);
                    mvc.NavigationController.PushViewController(uivc, true);
                }
            }
Пример #3
0
 public TableViewDataSource(List <RogetSection> list, MainViewController controller, SectionViewController sectionController)
 {
     this.list = list;
     mvc       = controller;
     svc       = sectionController;
 }
Пример #4
0
 public TableViewDataSource(List<RogetSection> list, MainViewController controller, SectionViewController sectionController)
 {
     this.list = list;
     mvc = controller;
     svc = sectionController;
 }
Пример #5
0
            /// <summary>
            /// A section was touched. Either show the next level of of Sections
            /// or load a different view for Categories
            /// </summary>
            public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
            {
                Console.WriteLine("SECTION TableViewDelegate.RowSelected: Label={0}", list[indexPath.Row].Name);

                if (svc.Sections[indexPath.Row].Sections.Count == 0)
                {	// show words
                    Console.WriteLine("  show words {0} to {1}", list[indexPath.Row].StartCategory, list[indexPath.Row].EndCategory);
                    CategoryViewController secvc = new CategoryViewController(mvc, list[indexPath.Row].StartCategory, list[indexPath.Row].EndCategory);
                    secvc.Title = list[indexPath.Row].Name;
                    mvc.NavigationController.PushViewController(secvc,true);
                }
                else
                {	// show more sections (more hierarchy)
                    SectionViewController uivc = new SectionViewController(mvc);
                    uivc.Title = list[indexPath.Row].Name;
                    uivc.Sections = svc.Sections[indexPath.Row].Sections;
                    Console.WriteLine("  thesaurus count: " + uivc.Sections.Count);
                    mvc.NavigationController.PushViewController(uivc,true);
                    }
            }
Пример #6
0
            /// <summary>
            /// If there are subsections in the hierarchy, navigate to those
            /// ASSUMES there are _never_ Categories hanging off the root in the hierarchy
            /// </summary>
            public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
            {
                Console.WriteLine("MAIN TableViewDelegate.RowSelected: Label={0}", list[indexPath.Row].Name);

                SectionViewController uivc = new SectionViewController(mvc);
                uivc.Title = list[indexPath.Row].Name;
                uivc.Sections = mvc.Classes[indexPath.Row].Sections;
                if (uivc.Sections.Count == 0)
                {
                    Console.WriteLine("Doesn't support 'words' hanging off the root RogetClass elements");
                }
                else
                {
                    Console.WriteLine("  thesaurus count: " + uivc.Sections.Count);
                    mvc.NavigationController.PushViewController(uivc,true);
                    }
            }