예제 #1
0
        public override void Load(RSFileReader br)
        {
            byte tag;

            while ((tag = br.ReadByte()) != 0)
            {
                switch (tag)
                {
                case 10: Id = br.ReadInt64(); break;

                case 11:
                    Name        = br.ReadString();
                    FilePath    = br.ReadString();
                    Description = br.ReadString();
                    break;

                case 12:
                    ImageData = br.ReadImage();
                    break;

                case 13:
                    List <MNReferencedSpot> safe = SafeSpots;
                    MNReferencedSpot        spot = new MNReferencedSpot();
                    spot.Load(br);
                    safe.Add(spot);
                    break;

                default:
                    break;
                }
            }
        }
예제 #2
0
파일: SMImage.cs 프로젝트: gopa810/Rambha
        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));
        }
예제 #3
0
파일: SMImage.cs 프로젝트: gopa810/Rambha
        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);
                    }
                }
            }
        }
예제 #4
0
파일: SMImage.cs 프로젝트: gopa810/Rambha
        public override void OnDropMove(PVDragContext dc)
        {
            HoverSpot = null;
            if (Img != null && Img.Image != null)
            {
                Debugger.Log(0, "", string.Format("Finding spot {0} :: {1} :: {2}\n", showRect, sourceRect, dc.lastPoint));
                MNReferencedSpot spot = Img.Image.FindSpot(showRect, sourceRect, dc.lastPoint);
                if (spot != null && spot.ContentType == SMContentType.TaggedArea)
                {
                    HoverSpot = spot;
                }
            }

            base.OnDropMove(dc);
        }