private void RequestImage(object state) { try { object[] on = state as object[]; UIImageView controller = on [0] as UIImageView; iportogruarocategories imgmain = on [1] as iportogruarocategories; if (imgmain == null) { return; } if (imgmain.icon_image == null) { return; } if (imgmain.icon_image.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_image.Replace("/", "").Replace("-", "").Replace(".", "").Replace(",", "") + ".png", imgmain.icon_image);// ;; 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}); foundImg = true; imageView.Layer.BorderColor = UIColor.LightGray.CGColor; imageView.Layer.BorderWidth = 1.0f; imageView.ContentMode = UIViewContentMode.Center; RefreshImage(controller); } ); // imgRoom = null; } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
private void RequestImage(object state) { try { object[] on = state as object[]; UIImageView controller = on [0] as UIImageView; iportogruarocategories imgmain = on [1] as iportogruarocategories; if (imgmain == null) { return; } if (imgmain.icon_image == null) { return; } if (imgmain.icon_image.Length > 0) { UIImage imgRoom; imgRoom = ImageHotel(imgmain.cat_id + "_s.png", imgmain.icon_image); // ;; UIImage.LoadFromData (imageData);// .Add(new BasicTableImageItem(){ Image = new UIImageView ( UIImage.LoadFromData (imageData)).Image , RoomType = controller.RoomType}); if (imgRoom == null) { NSUrl imageUrl = NSUrl.FromString(imgmain.icon_image); NSData imageData = NSData.FromUrl(imageUrl); imgRoom = UIImage.LoadFromData(imageData); // ;; UIImage.LoadFromData (imageData);// .Add(new BasicTableImageItem(){ Image = new UIImageView ( UIImage.LoadFromData (imageData)).Image , RoomType = controller.RoomType}); } if (imgRoom != null) { InvokeOnMainThread(delegate { controller.Image = imgRoom; // ;; UIImage.LoadFromData (imageData);// .Add(new BasicTableImageItem(){ Image = new UIImageView ( UIImage.LoadFromData (imageData)).Image , RoomType = controller.RoomType}); RefreshImage(state); } ); //imgRoom = null; } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }