Пример #1
0
        /*
         * 1.- The image should be big
         * 2.- the name of the pos, shoube be putend more to the right
         *
         * Iphone:
         * 3.- the label should be set in to lines when the are necesarry
         * 4.- the distance and distance image shulb be beloww the name
         *
         * Ipad:
         * 4.- the distance and the image distance staty the same
         *
         * */
        private void RequestImage(object state)
        {
            try {
                object[]        on         = state as object[];
                UIImageView     controller = on [0] as UIImageView;
                iportogruaropos imgmain    = on [1] as iportogruaropos;

                if (imgmain == null)
                {
                    return;
                }

                if (imgmain.icon == null)
                {
                    return;
                }

                if (imgmain.icon.Length > 0)
                {
                    // NSUrl imageUrl = NSUrl.FromString (imgmain.stringUrl);
                    // NSData imageData = NSData.FromUrl (imageUrl);

                    //BEM_Chain.UvCache.ImageHotel (imgmain.HotelParameters.PropertyNumber + imgmain.Room.RoomCode+ "_g.png", imgmain.ImageName);// ;;    UIImage.LoadFromData (imageData);//   .Add(new BasicTableImageItem(){ Image = new UIImageView (   UIImage.LoadFromData (imageData)).Image , RoomType  =  controller.RoomType});
                    //  string urlImg =  imgmain.stringUrl;

                    UIImage imgRoom = ImageHotel(imgmain.icon.Replace("/", "").Replace("-", "").Replace(".", "").Replace(",", "") + ".png", imgmain.icon);// ;;    UIImage.LoadFromData (imageData);//   .Add(new BasicTableImageItem(){ Image = new UIImageView (   UIImage.LoadFromData (imageData)).Image , RoomType  =  controller.RoomType});
                    //UIImage imgRoom = UIImage.LoadFromData (imageData);//   .Add(new BasicTableImageItem(){ Image = new UIImageView (   UIImage.LoadFromData (imageData)).Image , RoomType  =  controller.RoomType});

                    if (imgRoom != null)
                    {
                        InvokeOnMainThread(delegate {
                            controller.Image       = imgRoom;                           //SpCache.ImageUser (imgmain.UserId.ToString()+ "_g.png", urlImg);// ;;    UIImage.LoadFromData (imageData);//   .Add(new BasicTableImageItem(){ Image = new UIImageView (   UIImage.LoadFromData (imageData)).Image , RoomType  =  controller.RoomType});
                            controller.ContentMode = UIViewContentMode.ScaleAspectFill; //20130628 era Center
                            RefreshImage(controller);
                        }
                                           );
                        // imgRoom = null;
                    }
                }
            } catch (Exception ex) {
                Console.WriteLine(ex.ToString());
            }
        }
Пример #2
0
        // Customize the appearance of table view cells.
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            var item = list [indexPath.Row];

            if (item.isPresentAsCategory)
            {
                posItem cell = tableView.DequeueReusableCell(cellIdentifier) as posItem;

                if (cell == null)
                {
                    cell          = new posItem(cellIdentifier, controller.UserInterfaceIdiomIsPhoneProp);
                    cell.isIphone = controller.UserInterfaceIdiomIsPhoneProp;
                    //cell.controller = controller as UIDetail;

                    //viewTbl.Layer.BorderWidth = 0.5f;
                    //viewTbl.Layer.BorderColor = UIColor.FromRGB (102, 153, 173).CGColor;
                    UIView viewTbl = new UIView(new System.Drawing.RectangleF(0, 0, 1024, 92));
                    viewTbl.AutosizesSubviews = true;
                    viewTbl.AutoresizingMask  = UIViewAutoresizing.FlexibleWidth;
                    //viewTbl.Layer.BorderWidth = 0.5f;
                    //viewTbl.Layer.BorderColor = UIColor.FromRGB (102, 153, 173).CGColor;
                    viewTbl.BackgroundColor = UIColor.Clear;
                    //viewTbl.BackgroundColor = UIColor.Yellow;
                    viewTbl.Layer.MasksToBounds = true;
                    //viewTbl.Layer.CornerRadius = 5;

                    var oGradienttblMain = new CAGradientLayer();
                    oGradienttblMain.BorderWidth = 0f;

                    //oGradienttblMain.CornerRadius  = 3;
                    oGradienttblMain.Frame  = new System.Drawing.RectangleF(0, 0, 1024, 92);
                    oGradienttblMain.Colors = new CGColor[] {
                        //20130628

                        /*UIColor.FromRGB (255,255,255).CGColor,
                         * UIColor.FromRGB (248,248,248).CGColor,
                         * UIColor.FromRGB (238,238,238).CGColor,
                         * UIColor.FromRGB (229,229,229).CGColor,
                         * UIColor.FromRGB (220,220,220).CGColor*/
                        UIColor.FromRGB(255, 255, 255).CGColor,
                        UIColor.FromRGB(255, 255, 255).CGColor,
                        UIColor.FromRGB(255, 255, 255).CGColor,
                        UIColor.FromRGB(248, 248, 248).CGColor,
                        UIColor.FromRGB(234, 234, 234).CGColor
                    };
                    viewTbl.Layer.InsertSublayer(oGradienttblMain, 0);                     // .AddSublayer (oGradient);
                    //cell.controller = controller as UIDetail;

                    //viewTbl.Layer.BorderWidth = 0.5f;
                    //viewTbl.Layer.BorderColor = UIColor.FromRGB (102, 153, 173).CGColor;
                    cell.BackgroundView = viewTbl;
                }
                iportogruaropos cat = new iportogruaropos();
                cat.icon   = item.icon_image;
                cat.poi_id = item.cat_id;
                cat.title  = item.name;



                cat.lat = item.lat;
                cat.lon = item.lon;

                cell.userMember = cat;
                //if (indexPath.Section == 2)
                cell.UpdateCell(list [indexPath.Row].name);                 //,ItemsDinings [indexPath.Section].mapFeature + " >> " + ItemsDinings [indexPath.Section].adress);

                return(cell);
            }
            else
            {
                mainItem cell = tableView.DequeueReusableCell(cellIdentifier) as mainItem;

                if (cell == null)
                {
                    cell = new mainItem(cellIdentifier, controller.UserInterfaceIdiomIsPhoneProp);

                    UIView viewTbl = new UIView(cell.Bounds);
                    //viewTbl.Layer.BorderWidth = 0.5f;
                    //viewTbl.Layer.BorderColor = UIColor.FromRGB (102, 153, 173).CGColor;
                    viewTbl.BackgroundColor     = UIColor.Clear;
                    viewTbl.BackgroundColor     = UIColor.White;
                    viewTbl.Layer.MasksToBounds = true;
                    //viewTbl.Layer.CornerRadius = 5;

                    var oGradienttblMain = new CAGradientLayer();
                    oGradienttblMain.BorderWidth = 0f;

                    //oGradienttblMain.CornerRadius  = 3;
                    oGradienttblMain.Frame  = new System.Drawing.RectangleF(0, 0, 1024, 51);
                    oGradienttblMain.Colors = new CGColor[] {
                        //20130628
                        UIColor.FromRGB(255, 255, 255).CGColor,
                        UIColor.FromRGB(248, 248, 248).CGColor,
                        UIColor.FromRGB(238, 238, 238).CGColor,
                        UIColor.FromRGB(229, 229, 229).CGColor,
                        UIColor.FromRGB(220, 220, 220).CGColor
                    };
                    viewTbl.Layer.InsertSublayer(oGradienttblMain, 0);             // .AddSublayer (oGradient);
                    viewTbl.AutosizesSubviews = true;
                    viewTbl.AutoresizingMask  = UIViewAutoresizing.FlexibleWidth;
                    cell.BackgroundView       = viewTbl;
                }

                cell.userMember = list [indexPath.Row];
                //if (indexPath.Section == 2)
                cell.UpdateCell(list [indexPath.Row].name);//,ItemsDinings [indexPath.Section].mapFeature + " >> " + ItemsDinings [indexPath.Section].adress);

                return(cell);
            }
        }
Пример #3
0
        /*
         * public override float GetHeightForRow (UITableView tableView, NSIndexPath indexPath)
         * {
         *      return 60;
         * }
         */

        public sourceMoreInfo(UiDetailScreen controller, iportogruaropos _item)
        {
            item = _item;
            this.detailController = controller;
        }
Пример #4
0
 public sourceMoreInfo(UiPosMoreInfoListController controller, iportogruaropos _item)
 {
     item            = _item;
     this.controller = controller;
 }
Пример #5
0
 public UiPosMoreInfoListController(iportogruaropos _item) : base(UITableViewStyle.Plain)
 {
     item = _item;
 }