コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            setstyle();
            if (modeSearch == true)
            {
                sourcePos      = new sourceSecondCategory(null, lstSearch);
                tblMain.Source = sourcePos;
                tblMain.ReloadData();
                setLoadingViewStyle(this.tblMain);
            }
            else
            {
                //starthud ();
                reloading = true;
                var indicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.White);
                this.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(indicator);
                indicator.StartAnimating();
                ThreadPool.QueueUserWorkItem(state =>
                {
                    lst = new Mainiportogruaropos().getPost(cat_id, true);
                    //var lst = new iportogruaroLibraryShared.subCategorys().getSubCategorys(cat_id,true);

                    InvokeOnMainThread(delegate {
                        tblMain.Source = new sourcePosItemsCustom(this, lst);
                        tblMain.ReloadData();
                        setLoadingViewStyle(this.tblMain);
                        reloading = false;
                        this.NavigationItem.LeftBarButtonItem = null;
                        //stophud();
                    }
                                       );
                });
            }
        }
コード例 #2
0
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            if (this.controller.reloading == true)
            {
                return;
            }

            var item = list[indexPath.Row];

            if (item.parent == "POS" || item.isPresentAsCategory == true)
            {
                var lstpos = new Mainiportogruaropos().getAllPost();

                if (lstpos != null)
                {
                    List <iportogruaropos> auxPos = (from c in lstpos
                                                     orderby c.title ascending
                                                     where
                                                     c.poi_id.ToLower() == item.cat_id
                                                     select c).ToList();
                    if (auxPos != null)
                    {
                        if (auxPos.Count > 0)
                        {
                            var itempos = auxPos[0];

                            if (itempos.poi_id == null)
                            {
                                return;
                            }

                            if (itempos.poi_id == "0")
                            {
                                return;
                            }

                            var detail = new UiDetailScreen();
                            //detail.controllerPast = this.controller;
                            detail.dataPos     = itempos;
                            detail.positionPos = indexPath.Row;
                            this.controller.NavigationController.PushViewController(detail, true);
                        }
                    }
                }
                return;
            }

            if (item.parent != "0")
            {
                if (subCategorys.ishasSong(item))
                {
                    this.controller.NavigationController.PushViewController(new UiCategoryListController()
                    {
                        cat_id = item.cat_id, Title = System.Web.HttpUtility.HtmlDecode(item.name)
                    }, true);
                }
                else
                {
                    detail        = new UiPosList();
                    detail.Title  = System.Web.HttpUtility.HtmlDecode(item.name);
                    detail.cat_id = item.cat_id;
                    this.controller.NavigationController.PushViewController(detail, true);
                }
            }
            else
            {
                if (item.cat_id == "0")
                {
                    return;
                }



                this.controller.NavigationController.PushViewController(new UiCategoryListController()
                {
                    cat_id = item.cat_id, Title = System.Web.HttpUtility.HtmlDecode(item.name)
                }, true);
            }
        }