コード例 #1
0
 public override void OnPaint(Graphics graphics)
 {
     if (graphics != null)
     {
         Pen   pen      = WindowlessControlBase.CreatePen(base.ForeColor);
         Point location = base.Location;
         if (isLeft)
         {
             location.Offset(-base.Size.Width, 0);
         }
         graphics.FillRectangle(WindowlessControlBase.CreateSolidBrush(base.BackColor), new Rectangle(location, base.Size));
         Point pt     = location;
         Point point  = location;
         Point point2 = location;
         Point pt2    = location;
         Point point3 = location;
         Point pt3    = location;
         if (base.Container.GetCurrentScale() == WindowlessControlScale.Normal)
         {
             pt.Offset(new Point(0, 2));
             point.Offset(new Point(base.Size.Width, 2));
             point2.Offset(new Point(base.Size.Width - 3, 0));
             pt2.Offset(new Point(base.Size.Width - 3, base.Size.Height - 1));
             point3.Offset(new Point(3, 0));
             pt3.Offset(new Point(3, base.Size.Height - 1));
             graphics.DrawLine(pen, pt, point);
             if (isToArrow)
             {
                 graphics.DrawLine(pen, point, point2);
                 graphics.DrawLine(pen, point, pt2);
             }
             else
             {
                 graphics.DrawLine(pen, pt, point3);
                 graphics.DrawLine(pen, pt, pt3);
             }
         }
         else
         {
             pt.Offset(new Point(0, 1));
             point.Offset(new Point(base.Size.Width, 1));
             point2.Offset(new Point(base.Size.Width - 1, 0));
             pt2.Offset(new Point(base.Size.Width - 1, 2));
             point3.Offset(new Point(1, 0));
             pt3.Offset(new Point(1, 2));
             graphics.DrawLine(pen, pt, point);
             if (isToArrow)
             {
                 graphics.DrawLine(pen, point2, pt2);
             }
             else
             {
                 graphics.DrawLine(pen, point3, pt3);
             }
         }
     }
 }
コード例 #2
0
 public override void OnPaint(Graphics graphics)
 {
     if (graphics != null)
     {
         Size timeBoxSize = GetTimeBoxSize(base.Container.GetCurrentScale());
         if (base.IsHighlighted)
         {
             Rectangle rect = new Rectangle(base.Location, base.Size);
             rect.Inflate(-1, -1);
             graphics.FillRectangle(WindowlessControlBase.CreateSolidBrush(base.BackColor), rect);
             graphics.DrawRectangle(WindowlessControlBase.CreatePen(highlightBorderColor), rect);
         }
         else
         {
             base.OnPaint(graphics);
             graphics.FillRectangle(WindowlessControlBase.CreateSolidBrush(defaultBackColor), new Rectangle(base.Location, timeBoxSize));
         }
         string s = currentRowItem.Date.ToLongTimeString() + SR.GetString("SL_TimeMillSecondSep") + currentRowItem.Date.Millisecond.ToString(CultureInfo.CurrentUICulture);
         graphics.DrawString(s, WindowlessControlBase.CreateFont(base.FontSize), WindowlessControlBase.CreateSolidBrush(base.ForeColor), new PointF((float)(base.Location.X + 1), (float)(base.Location.Y + 1)));
     }
 }
コード例 #3
0
 public override void OnPaint(Graphics graphics)
 {
     if (base.IsHighlighted)
     {
         Rectangle rect = new Rectangle(base.Location, base.Size);
         rect.Inflate(-1, -1);
         graphics.FillRectangle(WindowlessControlBase.CreateSolidBrush(base.BackColor), rect);
         Point location  = rect.Location;
         Point location2 = rect.Location;
         location2.Offset(rect.Width, 0);
         Point location3 = rect.Location;
         location3.Offset(0, rect.Height);
         Point location4 = rect.Location;
         location4.Offset(rect.Width, rect.Height);
         graphics.DrawLine(WindowlessControlBase.CreatePen(highlightBorderColor), location, location2);
         graphics.DrawLine(WindowlessControlBase.CreatePen(highlightBorderColor), location3, location4);
     }
     else
     {
         base.OnPaint(graphics);
     }
 }
コード例 #4
0
 public override void OnPaint(Graphics graphics)
 {
     if (graphics != null)
     {
         Pen pen;
         Pen pen2;
         if (isMouseOver)
         {
             pen  = WindowlessControlBase.CreatePen(messageTransferMouseOverColor, (float)lineWidth);
             pen2 = WindowlessControlBase.CreatePen(messageTransferMouseOverColor);
         }
         else
         {
             pen  = WindowlessControlBase.CreatePen(messageTransferColor, (float)lineWidth);
             pen2 = WindowlessControlBase.CreatePen(messageTransferColor);
         }
         Point point = endPoint;
         point.Offset(isToArrow ? (-lineWidth) : lineWidth, 0);
         graphics.DrawLines(pen, new Point[4]
         {
             startPoint,
             secondPoint,
             thirdPoint,
             point
         });
         Point point2 = point;
         int   num    = lineWidth;
         point2.Offset(0, -lineWidth);
         while (num > 0)
         {
             Point pt = point2;
             pt.Offset(0, num * 2);
             graphics.DrawLine(pen2, point2, pt);
             point2.Offset(isToArrow ? 1 : (-1), 1);
             num--;
         }
     }
 }
コード例 #5
0
        public override void OnPaint(Graphics graphics)
        {
            base.OnPaint(graphics);
            if (currentTraceRecordItem != null)
            {
                int   innerBoxEdge = GetInnerBoxEdge(base.Container.GetCurrentScale(), base.Size.Height);
                int   num          = (base.Size.Width - base.Size.Height) / 2 + 1;
                Point point        = new Point(base.Location.X + num, base.Location.Y + 1);
                bool  flag         = true;
                if (isToChildActivity && currentTraceRecordItem.SeverityLevel != 0)
                {
                    Color color = defaultBackColor;
                    switch (currentTraceRecordItem.SeverityLevel)
                    {
                    case TraceRecordSetSeverityLevel.Error:
                        color = errorTransferBackColor;
                        break;

                    case TraceRecordSetSeverityLevel.Warning:
                        color = warningTransferBackColor;
                        break;
                    }
                    Rectangle rect = new Rectangle(base.Location, base.Size);
                    rect.Inflate(-1, -1);
                    graphics.FillRectangle(WindowlessControlBase.CreateSolidBrush(color), rect);
                }
                if (base.IsHighlighted && currentTraceRecordItem.SeverityLevel == TraceRecordSetSeverityLevel.Normal)
                {
                    Rectangle rect2 = new Rectangle(base.Location, base.Size);
                    rect2.Inflate(0, -1);
                    graphics.FillRectangle(WindowlessControlBase.CreateSolidBrush(highlightedTraceColor), rect2);
                }
                if (isMouseOver)
                {
                    graphics.FillRectangle(WindowlessControlBase.CreateSolidBrush(mouseOverTraceColor), new Rectangle(base.Location, base.Size));
                    flag = false;
                }
                if (currentTraceRecordItem.CurrentTraceRecord.Level == TraceEventType.Error || currentTraceRecordItem.CurrentTraceRecord.Level == TraceEventType.Critical)
                {
                    Image image    = errorTraceImage;
                    Point location = point;
                    int   num2     = innerBoxEdge;
                    graphics.DrawImage(image, new Rectangle(location, new Size(num2, num2)));
                    flag = false;
                }
                else if (currentTraceRecordItem.CurrentTraceRecord.Level == TraceEventType.Warning || (isToChildActivity && currentTraceRecordItem.SeverityLevel == TraceRecordSetSeverityLevel.Warning))
                {
                    Image image2    = wariningTraceImage;
                    Point location2 = point;
                    int   num3      = innerBoxEdge;
                    graphics.DrawImage(image2, new Rectangle(location2, new Size(num3, num3)));
                    flag = false;
                }
                else if (currentTraceRecordItem.CurrentTraceRecord.IsTransfer)
                {
                    if (currentTraceRecordItem.CurrentTraceRecord.ActivityID == CurrentActivityColumnItem.CurrentActivity.Id)
                    {
                        Image image3    = transferOutTraceImage;
                        Point location3 = point;
                        int   num4      = innerBoxEdge;
                        graphics.DrawImage(image3, new Rectangle(location3, new Size(num4, num4)));
                    }
                    else
                    {
                        Image image4    = transferInTraceImage;
                        Point location4 = point;
                        int   num5      = innerBoxEdge;
                        graphics.DrawImage(image4, new Rectangle(location4, new Size(num5, num5)));
                    }
                    flag = false;
                }
                else if (currentTraceRecordItem.CurrentTraceRecord.IsMessageLogged)
                {
                    Image image5    = messageTraceImage;
                    Point location5 = point;
                    int   num6      = innerBoxEdge;
                    graphics.DrawImage(image5, new Rectangle(location5, new Size(num6, num6)));
                    flag = false;
                }
                else if (currentTraceRecordItem.CurrentTraceRecord.IsMessageSentRecord)
                {
                    Image image6    = messageSentTraceImage;
                    Point location6 = point;
                    int   num7      = innerBoxEdge;
                    graphics.DrawImage(image6, new Rectangle(location6, new Size(num7, num7)));
                    flag = false;
                }
                else if (currentTraceRecordItem.CurrentTraceRecord.IsMessageReceivedRecord)
                {
                    Image image7    = messageReceivedTraceImage;
                    Point location7 = point;
                    int   num8      = innerBoxEdge;
                    graphics.DrawImage(image7, new Rectangle(location7, new Size(num8, num8)));
                    flag = false;
                }
                if (flag)
                {
                    if (currentTraceRecordItem.RelatedActivityItem.IsActiveActivity)
                    {
                        Brush brush     = WindowlessControlBase.CreateSolidBrush(activeActivityTraceColor);
                        Point location8 = point;
                        int   num9      = innerBoxEdge;
                        graphics.FillRectangle(brush, new Rectangle(location8, new Size(num9, num9)));
                        Pen   pen       = WindowlessControlBase.CreatePen(activeTraceBorderColor);
                        Point location9 = point;
                        int   num10     = innerBoxEdge;
                        graphics.DrawRectangle(pen, new Rectangle(location9, new Size(num10, num10)));
                    }
                    else
                    {
                        Brush brush2     = WindowlessControlBase.CreateSolidBrush(defaultActivityTraceColor);
                        Point location10 = point;
                        int   num11      = innerBoxEdge;
                        graphics.FillRectangle(brush2, new Rectangle(location10, new Size(num11, num11)));
                        Pen   pen2       = WindowlessControlBase.CreatePen(defaultTraceBorderColor);
                        Point location11 = point;
                        int   num12      = innerBoxEdge;
                        graphics.DrawRectangle(pen2, new Rectangle(location11, new Size(num12, num12)));
                    }
                }
                if (base.IsHighlighted && currentTraceRecordItem.SeverityLevel == TraceRecordSetSeverityLevel.Normal)
                {
                    Rectangle rectangle = new Rectangle(base.Location, base.Size);
                    rectangle.Inflate(0, -1);
                    Point location12 = rectangle.Location;
                    Point location13 = rectangle.Location;
                    location13.Offset(rectangle.Width, 0);
                    Point location14 = rectangle.Location;
                    location14.Offset(0, rectangle.Height);
                    Point location15 = rectangle.Location;
                    location15.Offset(rectangle.Width, rectangle.Height);
                    graphics.DrawLine(WindowlessControlBase.CreatePen(highlightedBorderColor), location12, location13);
                    graphics.DrawLine(WindowlessControlBase.CreatePen(highlightedBorderColor), location14, location15);
                }
            }
        }