コード例 #1
0
        /// <summary>
        /// Updates the cell.
        /// </summary>
        /// <param name="collectionView">Collection view.</param>
        /// <param name="indexpath">Indexpath.</param>
        /// <param name="image">Image.</param>
        /// <param name="itemsList">Items list.</param>
        /// <param name="controller">Controller.</param>
        public void UpdateCell(UICollectionView collectionView, NSIndexPath indexpath, UIImage image, List <UIImage> itemsList, UIViewController controller)
        {
            ImageView.RemoveGestureRecognizer(gr);
            ImageView.RemoveGestureRecognizer(tb);

            ImageView.AddGestureRecognizer(gr);
            ImageView.AddGestureRecognizer(tb);
            ImageView.UserInteractionEnabled = true;


            if (controller.GetType() == typeof(UICameraController))
            {
                this.cameraController = controller as UICameraController;
            }
            else if (controller.GetType() == typeof(InspectionViewController))
            {
                this.inspectionController = controller as InspectionViewController;
            }

            this.itemsList  = itemsList;
            count           = (itemsList.Count) - 1;
            ImageView.Image = image;
            this.indexpath  = indexpath;

            this.CollectionView = collectionView;
        }
コード例 #2
0
        /// <summary>
        /// Updates the Final Punch cell.
        /// </summary>
        /// <param name="parentController">Parent controller.</param>
        /// <param name="itemTableView">Item table view.</param>
        /// <param name="indexPath">Index path.</param>
        /// <param name="checkLstItem">Check lst item.</param>
        public void UpdateCell(InspectionViewController parentController, UITableView itemTableView, NSIndexPath indexPath, CheckList checkLstItem)
        {
            ResetUIView();
            UpdateUIContent(checkLstItem);
            weakUITableView = new WeakReference(itemTableView);
            Parent          = new WeakReference(parentController);


            var textDelegate = new FinalPunchTextViewDelegate(this, itemTableView);

            CommentsTextView.WeakDelegate = textDelegate;

            takePictureBtn.TouchUpInside     -= takePictureBtn_TouchUpInside;
            takePictureBtn.TouchUpInside     += takePictureBtn_TouchUpInside;
            punchSegmentControl.ValueChanged -= PunchSegmentControl_ValueChanged;
            punchSegmentControl.ValueChanged += PunchSegmentControl_ValueChanged;
            LoadPunchItemImages();

            if (checkLstItem.Result == ResultType.PASS || checkLstItem.Result == ResultType.FAIL)
            {
                takePictureBtn.Enabled         = true;
                takePictureBtn.BackgroundColor = UIColor.FromRGB(19, 95, 160);
                takePictureBtn.SetTitleColor(UIColor.White, UIControlState.Disabled);
            }
            else
            {
                takePictureBtn.Enabled         = false;
                takePictureBtn.BackgroundColor = UIColor.LightGray;
                takePictureBtn.SetTitleColor(UIColor.Black, UIControlState.Disabled);
            }
            parentController.buttonStyleRefresh(null);
        }
コード例 #3
0
 public InspectionItemSource(Option selectedOption, InspectionViewController parentController, UITableView optable, bool IsInSearchForCheckList)
 {
     this.parentController = parentController;
     this.optable          = optable;
     if (!IsInSearchForCheckList)
     {
         this.checkListItems = selectedOption.getCheckListItems();
         this.parentController.SetCheckListItems(this.checkListItems);
     }
     else
     {
     }
 }
コード例 #4
0
ファイル: ItemCell.cs プロジェクト: rheslar15/development
        public void UpdateCell(InspectionViewController parentController, UITableView checkListTableView, NSIndexPath indexPath, CheckList checkListItem)
        {
            this.checkListTableView = checkListTableView;
            this.parentController   = parentController;
            if (this.parentController != null)
            {
                IsCheckListItemActive = this.parentController.GetCheckListCommentsActive(indexPath.Row);
            }
            ResetUIView();
            UpdateUIContent(checkListItem);



            var textDelegate = new ItemTextViewDelegate(this);

            commentsTextView.WeakDelegate     = textDelegate;
            ChecklistSegControl.ValueChanged -= ChecklistSegControl_ValueChanged;
            ChecklistSegControl.ValueChanged += ChecklistSegControl_ValueChanged;
            parentController.buttonStyleRefresh(null);



            if (IsCheckListItemActive)
            {
                commentsTextView.Hidden = false;
                commentsLabel.Hidden    = false;
                htLabel.Constant        = 21;
                htTextView.Constant     = 87;
                wdTextView.Constant     = 300;
                htViewComment.Constant  = 107;

                //commentsTextView.ShouldBeginEditing ();

                //commentsTextView.BecomeFirstResponder();
            }
            else
            {
                htLabel.Constant        = 0;
                htTextView.Constant     = 0;
                htViewComment.Constant  = 0;
                commentsTextView.Hidden = true;
                commentsLabel.Hidden    = true;
            }
        }
コード例 #5
0
        // Update the Project Detail right View

        public void UpdateRightTableView(object sender, EventArgs e)
        {
            try
            {
                var arg = e as DashBoardEventArgs;

                if (arg != null && arg.RowType == RowType.Content)
                {
                    ProjectDetailView.Source = new DB_DetailTableSource(arg.InspectionDetail);
                    ProjectDetailView.Hidden = false;
                    ProjectDetailView.ReloadData();
                }
                else if (arg != null && arg.RowType == RowType.Header)
                {
                    ProjectDetailView.Hidden = true;
                }
                else if (arg != null && arg.RowType == RowType.None)
                {
                    if (arg.InspectionDetail.IsFinalise > 0)
                    {
                        UIAlertView alert = new UIAlertView(@"Alert", @"Inspection is Finalise", null, NSBundle.MainBundle.LocalizedString("OK", "OK"));
                        alert.Show();
                    }
                    else
                    {
                        arg.InspectionDetail.RepresentativeName = UserName;

                        if (!IsFirstLogin && arg.InspectionDetail.IsFinalise == 0)
                        {
                            arg.InspectionDetail.InspectionStarted = 1;
                        }

                        InspectionViewController inspectionViewController = this.Storyboard.InstantiateViewController("InspectionViewController") as InspectionViewController;
                        inspectionViewController.InspectionData = arg.InspectionDetail;
                        this.NavigationController.PushViewController(inspectionViewController, true);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Exception Occured in UpadteRightTableView method due to " + ex.Message);
            }
        }
コード例 #6
0
        public List <UIImageView> RestructureImages(List <UIImage> scrollImages, InspectionViewController parentController)
        {
            try
            {
                nfloat             h       = 100.0f;
                nfloat             w       = 100.0f;
                nfloat             padding = 10.0f;
                List <UIImageView> scrollImageCollection = new List <UIImageView> ();
                for (int i = 0; i < scrollImages.Count; i++)
                {
                    UIImageView imageView = new UIImageView();
                    imageView.Frame = new CGRect(padding * (i + 1) + (i * w), 0, w, h);
                    imageView.Image = scrollImages [i];

                    Action tapAction = new Action(
                        delegate {
                        //imageView = HighlightSelectedImage (imageView);
                        ImagePeviewViewController imagePreviewController = parentController.Storyboard.InstantiateViewController("ImagePeviewViewController") as ImagePeviewViewController;
                        imagePreviewController.ModalPresentationStyle    = UIModalPresentationStyle.FullScreen;
                        imagePreviewController.previewImage = imageView;
                        parentController.PresentViewController(imagePreviewController, false, null);
                    });

                    UITapGestureRecognizer tap = new UITapGestureRecognizer();
                    tap.AddTarget(tapAction);
                    imageView.AddGestureRecognizer(tap);
                    imageView.UserInteractionEnabled = true;

                    scrollImageCollection.Add(imageView);
                }

                return(scrollImageCollection);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Exception Occured in RestructureImages method due to " + ex.Message);
                return(new List <UIImageView> ());
            }
        }
コード例 #7
0
        /// <summary>
        /// Updates the guided photo cells.
        /// </summary>
        /// <param name="checkListItem">Check list item.</param>
        /// <param name="GuidedTableView">Guided table view.</param>
        /// <param name="parentController">Parent controller.</param>
        public async void UpdateGuidedPhotoCell(CheckList checkListItem, UITableView GuidedTableView, InspectionViewController parentController)
        {
            try {
                ResetUIView();
                this.ParentController = new WeakReference(parentController);
                this.GuidedTableView  = new WeakReference(GuidedTableView);
                this.CheckListItem    = new WeakReference(checkListItem);
                LoadGuidedView();

                guidedPhotoTkPicBtn.TouchUpInside -= guidedPhotoTkPicBtn_TouchUpInside;
                guidedPhotoTkPicBtn.TouchUpInside += guidedPhotoTkPicBtn_TouchUpInside;

                guidedPhotoTkPicBtn.SetTitleColor(UIColor.White, UIControlState.Normal);
                guidedPhotoTkPicBtn.Layer.CornerRadius = 5f;
                guidedPhotoTkPicBtn.Layer.BorderColor  = UIColor.FromRGB(18, 74, 143).CGColor;
                guidedPhotoTkPicBtn.Layer.BorderWidth  = 0.5f;
                guidedPhotoTkPicBtn.BackgroundColor    = UIColor.FromRGB(19, 95, 160);

                parentController.buttonStyleRefresh(null);
            } catch (Exception ex) {
                Debug.WriteLine("Exception Occured in UpdateCell method due to " + ex.Message);
            }
        }
コード例 #8
0
 public InspectionPunchSource(InspectionViewController parentController, UITableView optable, List <Model.Punch> punchItems)
 {
     this.parentController = parentController;
     this.punchItems       = punchItems;
 }
コード例 #9
0
//		public static PunchCell Create ()
//		{
//			return (PunchCell)Nib.Instantiate (null, null) [0];
//		}

        public void UpdateCell(InspectionViewController parentController, UITableView optionsTableView, NSIndexPath indexPath, List <Model.Punch> punchItems)
        {
            try
            {
                ResetUIView();
                this.parentController = parentController;
                this.optionsTableView = optionsTableView;
                this.indexPath        = indexPath;
                Model.Punch punchItem = punchItems.ElementAt(indexPath.Row);
                this.punch      = punchItem;
                this.punchItems = punchItems;

                foreach (var byteImage in this.punch.punchImages)
                {
                    imagesList.Add(ByteArrayToImage(byteImage));
                }

                if (Source == null)
                {
                    Source = new PunchDataSource(imagesList, this);
                }
                else
                {
                    Source.itemsList = imagesList;
                }
                imagesCollectionView.DataSource = Source;
                imagesCollectionView.ReloadData();

                //if the heading is addRow
                if (true == shouldInsertRow)
                {
                    Model.Punch punch = new Model.Punch();
                    punch.punchHeading = "Item " + indexPath.Row;
                    punchItems.Add(punch);

                    optionsTableView.BeginUpdates();
                    optionsTableView.InsertRows(new NSIndexPath[] { NSIndexPath.FromRowSection(indexPath.Row, indexPath.Section) }, UITableViewRowAnimation.None);
                    optionsTableView.EndUpdates();
                }

                punchHeadingLabel.Font      = UIFont.FromName("Helvetica", 17f);
                punchHeadingLabel.TextColor = UIColor.FromRGB(186, 190, 194);


                punchTakePicBtn.Layer.CornerRadius    = 5f;
                punchTakePicBtn.Layer.BackgroundColor = UIColor.FromRGB(18, 74, 143).CGColor;
                punchTakePicBtn.Layer.BorderWidth     = 0.5f;
                punchTakePicBtn.SetTitleColor(UIColor.White, UIControlState.Normal);

                punchTakePicBtn.TouchUpInside -= BtnTakePic_TouchUpInside;
                punchTakePicBtn.TouchUpInside += BtnTakePic_TouchUpInside;

                punchTextView.Layer.CornerRadius = 5f;
                punchTextView.Layer.BorderColor  = UIColor.FromRGB(186, 190, 194).CGColor;
                punchTextView.Layer.BorderWidth  = 0.5f;

                if (tap != null)
                {
                    this.RemoveGestureRecognizer(tap);
                }

                tap = new UITapGestureRecognizer();
                tap.AddTarget(tapAction);
                this.AddGestureRecognizer(tap);

                //punchImagesScrollView.Hidden = false;
                punchTakePicBtn.Hidden   = false;
                punchTextView.Hidden     = false;
                punchHeadingLabel.Hidden = false;


                int    showHeadingRowNumber = indexPath.Row + 1;
                string headingString        = "Item " + showHeadingRowNumber;
                punchHeadingLabel.Text = headingString;

                punchTextView.Text = punchItem.punchDescription;
                var textDelegate = new PunchTextViewDelegate(this);
                punchTextView.WeakDelegate = textDelegate;
                LoadPunchView();

                shouldInsertRow = false;
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Exception Occured in UpdateCell method due to " + ex.Message);
            }
        }
コード例 #10
0
 public InspectionSequenceSource(List <Model.ITraversible> SequenceItems, InspectionViewController parentController)
 {
     this.sequenceItems    = new WeakReference(SequenceItems);
     this.ParentController = new WeakReference(parentController);
 }