示例#1
0
        private void DrawCellAreas(IGraphicContext graphicContext)
        {
            foreach (var row in Rows)
            {
                var rowTop        = row.Top;
                var rowHeight     = row.Bottom - rowTop;
                var rowBodyTop    = row.Body.Top;
                var rowBodyHeight = row.Body.Bottom - row.Body.Top;

                foreach (var column in Columns)
                {
                    var columnLeft      = column.Left;
                    var columnWidth     = column.Right - columnLeft;
                    var columnBodyLeft  = column.Body.Left;
                    var columnBodyWidth = column.Body.Right - columnBodyLeft;

                    graphicContext.FillRectangle(
                        new Point(columnLeft, rowTop),
                        new Size(columnWidth, rowHeight),
                        new Color(50, Color.Green));

                    graphicContext.DrawRectangle(
                        new Point(columnLeft, rowTop),
                        new Size(columnWidth, rowHeight),
                        new Color(100, Color.Green),
                        Style.Common.LineStyle);

                    graphicContext.FillRectangle(
                        new Point(columnBodyLeft, rowBodyTop),
                        new Size(columnBodyWidth, rowBodyHeight),
                        new Color(50, Color.Red));

                    graphicContext.DrawRectangle(
                        new Point(columnBodyLeft, rowBodyTop),
                        new Size(columnBodyWidth, rowBodyHeight),
                        new Color(100, Color.Red),
                        Style.Common.LineStyle);
                }
            }
        }
示例#2
0
        protected override void DrawCore(IGraphicContext graphicContext)
        {
            float xFromCenterAbsoulute = Width / 2 * m_Activity.Level;
            float xFromCenterRelative  = m_Activity.Orientation == Orientation.Left
                                            ? -xFromCenterAbsoulute
                                            : xFromCenterAbsoulute;

            float x = m_Column.Body.Middle + xFromCenterRelative - Width / 2;

            float yStart = m_StartRow.Body.Bottom;
            float yEnd   = m_EndRow.Body.Bottom;

            var location = new Point(x, yStart);
            var size     = new Size(Width, yEnd - yStart);

            graphicContext.FillRectangle(location, size, Style.Activity.BackColor);
            graphicContext.DrawRectangle(location, size, Style.Activity.FrameColor, Style.Common.LineStyle);

            base.DrawCore(graphicContext);
        }
示例#3
0
        protected override void DrawCore(IGraphicContext graphicContext)
        {
            float yLine = m_TopRow.TopGap.Bottom - BottomOffset + 4;
            float yText = yLine + 2;

            float xStart = Parent.Location.X;
            float xEnd   = Parent.Location.X + Parent.Size.Width;

            if (!m_IsFirst)
            {
                graphicContext.DrawDashedLine(new Point(xStart, yLine), new Point(xEnd, yLine), Style.Fragment.OperandSeparatorWidth, Style.Fragment.OperandSeparatorColor, Style.Common.LineStyle);
            }

            Point textLocation = new Point(xStart + 5, yText);

            graphicContext.FillRectangle(textLocation, Size, Color.SemiTransparent);
            graphicContext.DrawText(
                textLocation, Size,
                m_GuardExpressionText,
                Style.Common.Font, Style.GuardExpression.FontSize, Style.GuardExpression.TextColor,
                HorizontalAlignment.Left, VerticalAlignment.Middle);

            base.DrawCore(graphicContext);
        }