Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bc"></param>
        /// <returns></returns>
        private static OrchShape CreateOrchShape(BaseShape bc)
        {
            OrchShape os = null;

            XLANGView.TrkMetadata data = bc.Relationship as XLANGView.TrkMetadata;

            if (data != null)
            {
                os      = new OrchShape();
                os.Text = bc.Text;
                os.Id   = data.ShapeID;

                //				Rectangle selRect = new Rectangle(
                //					bc.DesignSurfaceClientLocation.X-5,
                //					bc.DesignSurfaceClientLocation.Y-7,
                //					bc.NativeSize.Width,
                //                    bc.NativeSize.Height);

                Rectangle selRect = new Rectangle(
                    bc.DesignSurfaceClientLocation.X - 5,
                    bc.DesignSurfaceClientLocation.Y - 7,
                    bc.Width,
                    bc.Height);

                os.SelectionArea = new SelectionArea(
                    selRect.X,
                    selRect.Y,
                    selRect.Width,
                    selRect.Height);

                switch (bc.GetType().ToString())
                {
                case "Microsoft.VisualStudio.EFT.SendShape": os.ShapeType = ShapeType.SendShape; break;

                case "Microsoft.VisualStudio.EFT.ReceiveShape": os.ShapeType = ShapeType.ReceiveShape; break;

                case "Microsoft.VisualStudio.EFT.VariableAssignmentShape": os.ShapeType = ShapeType.VariableAssignment; break;

                case "Microsoft.VisualStudio.EFT.MessageAssignmentShape": os.ShapeType = ShapeType.MessageAssignment; break;
                }
            }

            return(os);
        }
Ejemplo n.º 2
0
        private static OrchShape CreateOrchShape(BaseShape bc)
        {
            OrchShape os = null;

            var data = bc.Relationship as XLANGView.TrkMetadata;

            if (data != null)
            {
                os = new OrchShape { Text = bc.Text, Id = data.ShapeID };

                var selRect = new Rectangle(
                    bc.DesignSurfaceClientLocation.X - 5,
                    bc.DesignSurfaceClientLocation.Y - 7,
                    bc.Width,
                    bc.Height);

                os.SelectionArea = new SelectionArea(
                    selRect.X,
                    selRect.Y,
                    selRect.Width,
                    selRect.Height);

                switch (bc.GetType().ToString())
                {
                    case "Microsoft.VisualStudio.EFT.SendShape": os.ShapeType = ShapeType.SendShape; break;
                    case "Microsoft.VisualStudio.EFT.ReceiveShape": os.ShapeType = ShapeType.ReceiveShape; break;
                    case "Microsoft.VisualStudio.EFT.VariableAssignmentShape": os.ShapeType = ShapeType.VariableAssignment; break;
                    case "Microsoft.VisualStudio.EFT.MessageAssignmentShape": os.ShapeType = ShapeType.MessageAssignment; break;
                }
            }

            return os;
        }
Ejemplo n.º 3
0
 public bool Contains(BaseShape shape, Point2 target, double radius)
 {
     return(Registered[shape.GetType()].Contains(shape, target, radius, Registered));
 }
Ejemplo n.º 4
0
 public bool Overlaps(BaseShape shape, Rect2 target, double radius)
 {
     return(Registered[shape.GetType()].Overlaps(shape, target, radius, Registered));
 }
Ejemplo n.º 5
0
 public PointShape TryToGetPoint(BaseShape shape, Point2 target, double radius)
 {
     return(Registered[shape.GetType()].TryToGetPoint(shape, target, radius, Registered));
 }