public override PSPDFMenuItem[] ShouldShowMenuItemsForAnnotations(PSPDFViewController pdfController, PSPDFMenuItem[] menuItems, CGRect rect, PSPDFAnnotation[] annotations, CGRect textRect, PSPDFPageView pageView)
        {
            if (annotations != null)
            {
                PSPDFMenuItem[] newItems = new PSPDFMenuItem[1];

                PSPDFMenuItem removeMenu = new PSPDFMenuItem(StringRef.Remove, delegate
                {
                    annotations[0].Deleted = true;
                    pageView.RemoveAnnotation(annotations[0], null, true);

                    if (SaveAnnotationEvent != null)
                    {
                        SaveAnnotationEvent();
                    }
                }, StringRef.Remove);
                newItems[0] = removeMenu;

                return(newItems);
            }

            return(menuItems);
        }
        public override PSPDFMenuItem[] ShouldShowMenuItemsForSelectedText(PSPDFViewController pdfController, PSPDFMenuItem[] menuItems, CGRect rect, String selectedText, CGRect textRect, PSPDFPageView pageView)
        {
            int addIndex = 0;

            PSPDFMenuItem[] newItems = new PSPDFMenuItem[1];
            if (menuItems != null)
            {
                for (int i = 0; i < menuItems.Length; i++)
                {
                    if (menuItems [i].Identifier == "Search")
                    {
                        newItems [addIndex] = menuItems [i];
                        addIndex++;
                    }
                }
            }

            if (newItems != null && addIndex != 0)
            {
                return(newItems);
            }
            return(null);
        }