Ejemplo n.º 1
0
 protected override void OnPaintSelected(ActivityDesignerPaintEventArgs e, bool primarySelection, Point[] segmentEditPoints)
 {
     if ((this.RootStateDesigner == null) || (this.RootStateDesigner.ActiveDesigner == null))
     {
         StateMachineTheme designerTheme = e.DesignerTheme as StateMachineTheme;
         if (designerTheme != null)
         {
             Size connectorCapSize = new Size(designerTheme.ConnectorSize.Width / 5, designerTheme.ConnectorSize.Height / 5);
             Size connectorSize    = designerTheme.ConnectorSize;
             using (Pen pen = new Pen(WorkflowTheme.CurrentTheme.AmbientTheme.SelectionForeColor, 1f))
             {
                 StateMachineDesignerPaint.DrawConnector(e.Graphics, pen, new List <Point>(this.ConnectorSegments).ToArray(), connectorCapSize, connectorSize, designerTheme.ConnectorStartCap, designerTheme.ConnectorEndCap);
             }
             if (base.Source != null)
             {
                 base.Source.OnPaint(e, false);
             }
             ReadOnlyCollection <Point> connectorSegments = this.ConnectorSegments;
             for (int i = 1; i < (connectorSegments.Count - 1); i++)
             {
                 this.PaintEditPoints(e, connectorSegments[i], false);
             }
             for (int j = 0; j < segmentEditPoints.Length; j++)
             {
                 this.PaintEditPoints(e, segmentEditPoints[j], true);
             }
             if (base.Target != null)
             {
                 base.Target.OnPaint(e, false);
             }
         }
     }
 }
Ejemplo n.º 2
0
 protected override void OnPaint(ActivityDesignerPaintEventArgs e)
 {
     if ((this.RootStateDesigner == null) || (this.RootStateDesigner.ActiveDesigner == null))
     {
         StateMachineTheme designerTheme = e.DesignerTheme as StateMachineTheme;
         if (designerTheme != null)
         {
             Size connectorCapSize = new Size(designerTheme.ConnectorSize.Width / 5, designerTheme.ConnectorSize.Height / 5);
             Size connectorSize    = designerTheme.ConnectorSize;
             StateMachineDesignerPaint.DrawConnector(e.Graphics, designerTheme.ConnectorPen, new List <Point>(this.ConnectorSegments).ToArray(), connectorCapSize, connectorSize, designerTheme.ConnectorStartCap, designerTheme.ConnectorEndCap);
         }
     }
 }
        protected override void OnPaintSelected(ActivityDesignerPaintEventArgs e, bool primarySelection, Point[] segmentEditPoints)
        {
            if (this.RootStateDesigner != null && this.RootStateDesigner.ActiveDesigner != null)
            {
                return; // we don't draw connectors in the EventDriven view
            }
            StateMachineTheme theme = e.DesignerTheme as StateMachineTheme;

            if (theme != null)
            {
                Size arrowCapSize = new Size(theme.ConnectorSize.Width / 5, theme.ConnectorSize.Height / 5);
                Size maxCapSize   = theme.ConnectorSize;

                using (Pen lineSelectionPen = new Pen(WorkflowTheme.CurrentTheme.AmbientTheme.SelectionForeColor, 1))
                {
                    StateMachineDesignerPaint.DrawConnector(e.Graphics,
                                                            lineSelectionPen,
                                                            new List <Point>(ConnectorSegments).ToArray(),
                                                            arrowCapSize,
                                                            maxCapSize,
                                                            theme.ConnectorStartCap,
                                                            theme.ConnectorEndCap);
                }

                if (this.Source != null)
                {
                    this.Source.OnPaint(e, false);
                }

                ReadOnlyCollection <Point> endSegmentEditPoints = ConnectorSegments;
                for (int i = 1; i < endSegmentEditPoints.Count - 1; i++)
                {
                    PaintEditPoints(e, endSegmentEditPoints[i], false);
                }

                for (int i = 0; i < segmentEditPoints.Length; i++)
                {
                    PaintEditPoints(e, segmentEditPoints[i], true);
                }

                if (this.Target != null)
                {
                    this.Target.OnPaint(e, false);
                }
            }
        }
        protected override void OnPaint(ActivityDesignerPaintEventArgs e)
        {
            if (this.RootStateDesigner != null && this.RootStateDesigner.ActiveDesigner != null)
            {
                return; // we don't draw connectors in the EventDriven view
            }
            StateMachineTheme theme = e.DesignerTheme as StateMachineTheme;

            if (theme != null)
            {
                Size arrowCapSize = new Size(theme.ConnectorSize.Width / 5, theme.ConnectorSize.Height / 5);
                Size maxCapSize   = theme.ConnectorSize;

                StateMachineDesignerPaint.DrawConnector(e.Graphics,
                                                        theme.ConnectorPen,
                                                        new List <Point>(ConnectorSegments).ToArray(),
                                                        arrowCapSize,
                                                        maxCapSize,
                                                        theme.ConnectorStartCap,
                                                        theme.ConnectorEndCap);
            }
        }
        protected override void OnPaintEdited(ActivityDesignerPaintEventArgs e, Point[] segments, Point[] segmentEditPoints)
        {
            if (this.RootStateDesigner != null && this.RootStateDesigner.ActiveDesigner != null)
            {
                return; // we don't draw connectors in the EventDriven view
            }
            StateMachineTheme theme = e.DesignerTheme as StateMachineTheme;

            if (theme != null)
            {
                using (Pen lineEditPen = new Pen(WorkflowTheme.CurrentTheme.AmbientTheme.SelectionForeColor, 1))
                {
                    lineEditPen.DashStyle = DashStyle.Dash;
                    e.Graphics.DrawLines(lineEditPen, segments);

                    if (Source != null)
                    {
                        Source.OnPaint(e, false);
                    }

                    for (int i = 1; i < segments.Length - 1; i++)
                    {
                        PaintEditPoints(e, segments[i], false);
                    }

                    for (int i = 0; i < segmentEditPoints.Length; i++)
                    {
                        PaintEditPoints(e, segmentEditPoints[i], true);
                    }

                    if (Target != null)
                    {
                        Target.OnPaint(e, false);
                    }
                }
            }
        }