/// <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); }
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; }
public bool Contains(BaseShape shape, Point2 target, double radius) { return(Registered[shape.GetType()].Contains(shape, target, radius, Registered)); }
public bool Overlaps(BaseShape shape, Rect2 target, double radius) { return(Registered[shape.GetType()].Overlaps(shape, target, radius, Registered)); }
public PointShape TryToGetPoint(BaseShape shape, Point2 target, double radius) { return(Registered[shape.GetType()].TryToGetPoint(shape, target, radius, Registered)); }