Exemplo n.º 1
0
        public override bool OnDropFinished(PVDragContext dc)
        {
            HoverSpot = null;
            if (HasImmediateEvaluation)
            {
                if (Img != null && Img.Image != null)
                {
                    MNReferencedImage img  = Img.Image;
                    MNReferencedSpot  spot = img.FindSpot(showRect, sourceRect, dc.lastPoint);
                    if (spot != null && spot.ContentType == SMContentType.TaggedArea &&
                        dc.draggedItem.Tag.Equals(spot.Name, StringComparison.CurrentCultureIgnoreCase))
                    {
                        spot.UIStateHighlighted = true;
                        return(base.OnDropFinished(dc));
                    }
                }

                if (!Tag.Equals(dc.draggedItem.Tag, StringComparison.CurrentCultureIgnoreCase))
                {
                    return(false);
                }
            }

            DroppedImage = dc.draggedItem.Image;
            DroppedTag   = dc.draggedItem.Tag;
            DroppedText  = dc.draggedItem.Text;

            return(base.OnDropFinished(dc));
        }
Exemplo n.º 2
0
        public override void OnTapEnd(PVDragContext dc)
        {
            base.OnTapEnd(dc);
            MNReferencedImage img = Img.Image;

            if (img == null)
            {
                return;
            }

            MNReferencedSpot spot = img.FindSpot(showRect, sourceRect, dc.lastPoint);

            if (spot != null)
            {
                if (spot.ContentType != SMContentType.TaggedArea)
                {
                    MNReferencedCore obj = Document.FindContentObject(spot.ContentType, spot.ContentId);

                    if (obj != null && (obj is MNReferencedSound) && Document.HasViewer)
                    {
                        Document.Viewer.OnEvent("OnPlaySound", obj as MNReferencedSound);
                    }
                }
            }
        }