コード例 #1
0
 private void ResetUIView()
 {
     CommentsTextView.Text = "";
     punchSegmentControl.SelectedSegment = -1;
     PunchHeading.Text = "";
     if (null != ImageLst)
     {
         foreach (var view in ImageLst)
         {
             view.Image = null;
             view.RemoveFromSuperview();
         }
         ImageLst.Clear();
     }
 }
コード例 #2
0
        private void LoadPunchItemImages()
        {
            try {
                locker = new object();
                ///Commented the changes for new requirements
                ResetTheCameraImageView();
                if (this.checkListItem.photos != null && this.checkListItem.photos.Count > 0)
                {
                    List <UIImage> currentinspectionItemImages = new List <UIImage> ();
                    foreach (var img in this.checkListItem.photos)
                    {
                        var imag = ByteArrayToImage(img);
                        currentinspectionItemImages.Add(imag);
                    }
                    if (currentinspectionItemImages.Count > 0)
                    {
                        var scrollViewImgs = RestructureImages(currentinspectionItemImages);
                        punchImgScrollView.AddSubviews(scrollViewImgs.ToArray());
                        if (scrollViewImgs != null && scrollViewImgs.Count > 0)
                        {
                            punchImgScrollView.ContentSize = new CoreGraphics.CGSize(scrollViewImgs.Count * scrollViewImgs.FirstOrDefault().Frame.Width + scrollViewImgs.Count * 10, 100);
                        }
                        if (null != ImageLst)
                        {
                            foreach (var view in ImageLst)
                            {
                                view.Image = null;
                                view.RemoveFromSuperview();
                            }
                            ImageLst.Clear();
                        }
                        if (ImageLst == null)
                        {
                            ImageLst = new List <UIImageView>();
                        }

                        ImageLst.AddRange(scrollViewImgs);
                        AddGestureEvents();
                    }
                }
            } catch (Exception ex) {
                Debug.WriteLine("Exception Occured in LoadPassView method due to " + ex.Message);
            }
        }
コード例 #3
0
 private void ResetUIView()
 {
     guidedOptionLabel.Text = "";
     if (imagesCollectionView != null)
     {
         foreach (var view in imagesCollectionView.Subviews)
         {
             if (view != null)
             {
                 if (view is UIImageView)
                 {
                     (view as UIImageView).Image = null;
                 }
                 view.RemoveFromSuperview();
                 view.Dispose();
             }
         }
     }
     if (null != ImageLst)
     {
         ImageLst.Clear();
         _imageLst.Clear();
     }
 }
コード例 #4
0
        public void UpdateCollectionImageView(List <UIImage> images)
        {
            try {
                List <byte[]> cameraImages = new List <byte[]> ();
                ///Commented the changes for new requirements
                checkListItem.photos = new List <byte[]>();
                foreach (var img in images)
                {
                    byte[] task   = ImageToByteArray(img);
                    var    imgArr = task;
                    cameraImages.Add(imgArr);
                }

                if (cameraImages.Count > 0)
                {
                    foreach (var imag in cameraImages)
                    {
                        ///Commented the changes for new requirements
                        checkListItem.photos.Add(imag);
                    }
                    itemTableView.ReloadData();
                }
                parentController.buttonStyleRefresh(null);
                if (ImageLst != null && ImageLst.Count > 0)
                {
                    foreach (var view in ImageLst)
                    {
                        view.Image = null;
                        view.RemoveFromSuperview();
                    }
                    ImageLst.Clear();
                }
            } catch (Exception ex) {
                Debug.WriteLine("Exception Occured in UpdateCollectionImageView method due to " + ex.Message);
            }
        }