void BindTable(List <Schemas.Search.SearchProductModel> locallistSearch)
        {
            SearchSource TableSource = new SearchSource(locallistSearch, this);

            SearchTableView.Source = TableSource;
            SearchTableView.ReloadData();
            SearchTableView.TableFooterView = new UIView();
        }
Beispiel #2
0
 void RefreshSearchData()
 {
     if (PageItemList == null || PageItemList.Count == 0)
     {
         SearchTableView.EnclosingScrollView.Hidden = true;
         NoResultLabel.Hidden      = false;
         NoResultLabel.StringValue = "Page Not Found.\n" +
                                     "The page you're looking for\n" +
                                     " doesn't exist in this publication. \nPlease try again.";
     }
     else
     {
         SearchTableView.EnclosingScrollView.Hidden = false;
         NoResultLabel.Hidden = true;
         var aObject = SearchTableView.Delegate;
         if (aObject is GoPageTableDelegate)
         {
             ((GoPageTableDelegate)aObject).UpdateData(PageItemList);
             SearchTableView.ReloadData();
         }
     }
 }
        partial void PopupButtonSelectChange(NSObject sender)
        {
            var button = (NSPopUpButton)sender;

            nint            index = button.IndexOfSelectedItem;
            var             rect  = button.Frame;
            CGSize          newSize;
            CGPoint         newPoint    = rect.Location;
            string          keyword     = keyWord;
            ContentCategory contentType = ContentCategory.All;
            nfloat          height      = rect.Height + 10;

            switch (index)
            {
            case 1:
                newSize = new CGSize(42, height);
                button.SetFrameSize(newSize);
                newPoint.X = 248;
                button.SetFrameOrigin(newPoint);
                contentType = ContentCategory.All;

                break;

            case 2:
                newSize = new CGSize(100, height);
                button.SetFrameSize(newSize);
                newPoint.X = 190;
                button.SetFrameOrigin(newPoint);
                contentType = ContentCategory.LegislationType;

                break;

            case 3:
                newSize = new CGSize(110, height);
                button.SetFrameSize(newSize);
                newPoint.X = 180;
                button.SetFrameOrigin(newPoint);
                contentType = ContentCategory.CommentaryType;

                break;

            case 4:
                newSize = new CGSize(158, height);
                button.SetFrameSize(newSize);
                newPoint.X = 132;
                button.SetFrameOrigin(newPoint);
                contentType = ContentCategory.FormsPrecedentsType;

                break;

            case 5:
                newSize = new CGSize(50, height);
                button.SetFrameSize(newSize);
                newPoint.X = 240;
                button.SetFrameOrigin(newPoint);
                contentType = ContentCategory.CaseType;

                break;
            }

            button.Title = button.TitleOfSelectedItem;

            List <ContentCategory> categoryList = new List <ContentCategory> (0);

            categoryList.Add(contentType);

            SearchResultsData = null;
            AddTimer();

            SearchResultsData = SearchUtil.Search(BookID, tocID, keyword, categoryList);
            //Console.WriteLine ("search end:{0} SearchResultsData:{1}", NSDate.Now.ToString(), SearchResultsData);

            if (SearchResultsData != null && SearchResultsData.SearchDisplayResultList != null && SearchResultsData.SearchDisplayResultList.Count != 0)
            {
                ((SearchTableDataSource)SearchTableView.DataSource).SearchResults = SearchResultsData;
                ((SearchTableDelegate)SearchTableView.Delegate).SearchResults     = SearchResultsData;
                SearchTableView.ReloadData();
                SearchTableView.Hidden = false;
                NoResultLabel.Hidden   = true;
            }
            else
            {
                SearchTableView.Hidden    = true;
                NoResultLabel.Hidden      = false;
                NoResultLabel.StringValue = "No search results found.";
            }

            RemoveLoadView();
        }