Exemplo n.º 1
0
        private static void GetSelectionAreas(Graphics g, BaseShape shape, OrchestrationOverviewImage orchestration)
        {
            try
            {
                foreach (BaseShape bc in shape.Shapes)
                {
                    if (bc is ReceiveShape ||
                        bc is SendShape ||
                        bc is MessageAssignmentShape ||
                        bc is VariableAssignmentShape)
                    {
                        OrchShape os = CreateOrchShape(bc);

                        if (os != null)
                        {
                            if (orchestration.ShapeMap != null)
                            {
                                orchestration.ShapeMap.Add(os);
                            }
                            //if (drawHotspots)
                            //{
                            //    DrawDebugRect(g, os.SelectionArea.GetRectangle());
                            //}
                        }
                    }

                    GetSelectionAreas(g, bc, orchestration);
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
        }
Exemplo 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);
        }
Exemplo n.º 3
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;
        }