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); } } } }
private void ReloadView() { if (base.CurrentActivity != null && base.CurrentDataSource != null) { WindowlessControlBase topMostHighlighedControl = base.Container.GetTopMostHighlighedControl(); base.Container.ClearView(); if (PerformAnalysis(isRestoring: true, reportError: true) && topMostHighlighedControl != null && topMostHighlighedControl is TraceRecordCellControl) { TraceRecordCellControl traceRecordCellControl = (TraceRecordCellControl)topMostHighlighedControl; if (traceRecordCellControl.CurrentTraceRecordItem != null) { base.Container.SelectTraceRecordItem(traceRecordCellControl.CurrentTraceRecordItem.CurrentTraceRecord, traceRecordCellControl.CurrentActivityColumnItem.CurrentActivity.Id); } } } RefreshOptionMenuHighlightStatus(); }
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))); } }
public MessageExchangeCellControl(IWindowlessControlContainer parentContainer, MessageExchangeCellItem item, IErrorReport errorReport) : base(3, parentContainer.GetCurrentScale(), parentContainer, new Point(0, 0), errorReport) { if (item != null && item.SentTraceRecordCellItem != null && item.ReceiveTraceRecordCellItem != null) { WindowlessControlBase windowlessControlBase = base.Container.FindWindowlessControl(item.SentTraceRecordCellItem); WindowlessControlBase windowlessControlBase2 = base.Container.FindWindowlessControl(item.ReceiveTraceRecordCellItem); if (windowlessControlBase != null && windowlessControlBase2 != null && windowlessControlBase is TraceRecordCellControl && windowlessControlBase2 is TraceRecordCellControl) { sendExecutionColumnItem = item.SentExecutionColumnItem; receiveExecutionColumnItem = item.ReceiveExecutionColumnItem; loggedMessageItems = item.RelatedMessageTraceCellItems; isToArrow = (sendExecutionColumnItem.ItemIndex < receiveExecutionColumnItem.ItemIndex); isInSameExecution = (sendExecutionColumnItem.ItemIndex == receiveExecutionColumnItem.ItemIndex); InitializeRedrawData((TraceRecordCellControl)windowlessControlBase, (TraceRecordCellControl)windowlessControlBase2); relatedControls.Add(windowlessControlBase); relatedControls.Add(windowlessControlBase2); if (loggedMessageItems != null && loggedMessageItems.Count != 0) { foreach (TraceRecordCellItem loggedMessageItem in loggedMessageItems) { WindowlessControlBase windowlessControlBase3 = base.Container.FindWindowlessControl(loggedMessageItem); if (windowlessControlBase3 != null && windowlessControlBase3 is TraceRecordCellControl) { relatedControls.Add(windowlessControlBase3); } } } relatedControls.Add(this); foreach (WindowlessControlBase relatedControl in relatedControls) { if (relatedControl is TraceRecordCellControl) { AddRelatedControlsForTraceRecord((TraceRecordCellControl)relatedControl, relatedControls); } } } } }
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); } }
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--; } } }
public HorzBundTitleControl(ActivityTraceModeAnalyzer analyzer, IWindowlessControlContainer container) { if (analyzer != null) { InitializeComponent(); this.container = container; Label value = new Label { AutoSize = false, Dock = DockStyle.Bottom, Height = 1, BackColor = Utilities.GetColor(ApplicationColors.TitleBorder) }; base.Controls.Add(value); WindowlessControlScale currentScale = container.GetCurrentScale(); int num = HorzBundRowControl.GetTimeBoxSize(currentScale).Width + HorzBundRowControl.GetDefaultBlank(currentScale); int num2 = num + ExecutionCellControl.GetDefaultBlank(currentScale); int num3 = num; foreach (ExecutionColumnItem executionColumnItem in analyzer.ExecutionColumnItems) { int num4 = TraceRecordCellControl.GetControlSize(currentScale).Width *executionColumnItem.ActivityColumnCount + ExecutionCellControl.GetDefaultBlock(currentScale) * (executionColumnItem.ActivityColumnCount - 1) + 2 * ExecutionCellControl.GetDefaultBlank(currentScale); PictureBox pictureBox = new PictureBox(); toolTip.SetToolTip(pictureBox, (string)pictureBox.Tag); pictureBox.Location = new Point(num, 0); pictureBox.BorderStyle = BorderStyle.None; pictureBox.Image = processTitleBackImage; pictureBox.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox.Size = new Size(num4, GetDefaultVSize(currentScale)); mainPanel.Controls.Add(pictureBox); num += num4 + HorzBundRowControl.GetDefaultBlock(currentScale); num3 += num4; Label label = new Label(); if (TraceViewerForm.IsThreadExecutionMode) { label.Text = executionColumnItem.CurrentExecutionInfo.ProcessName + SR.GetString("CF_LeftB") + executionColumnItem.CurrentExecutionInfo.ThreadID + SR.GetString("CF_RightB"); } else { label.Text = executionColumnItem.CurrentExecutionInfo.ProcessName; } label.Font = GetDefaultFont(currentScale); label.TextAlign = ContentAlignment.MiddleCenter; label.Dock = DockStyle.Fill; label.BackColor = Color.Transparent; toolTip.SetToolTip(label, executionColumnItem.CurrentExecutionInfo.ToString()); pictureBox.Controls.Add(label); for (int i = 0; i < executionColumnItem.ActivityColumnCount; i++) { Activity currentActivity = executionColumnItem[i].CurrentActivity; Label label2 = new Label(); string activityDisplayName = TraceViewerForm.GetActivityDisplayName(currentActivity); toolTip.SetToolTip(label2, activityDisplayName); int index = -1; ImageList imageList = null; if (container.GetCurrentScale() != WindowlessControlScale.XSmall) { if (executionColumnItem[i].CurrentActivity != null && executionColumnItem[i].CurrentActivity.ActivityType == ActivityType.RootActivity) { imageList = TraceViewerForm.GetImageFromImageList(Images.RootActivity, out index); } else if (executionColumnItem[i].CurrentActivity != null && ActivityAnalyzerHelper.IsHostRelatedActivity(executionColumnItem[i].CurrentActivity)) { imageList = ((executionColumnItem[i].CurrentActivity.ActivityType != ActivityType.ListenActivity) ? TraceViewerForm.GetImageFromImageList(Images.HostActivityIcon, out index) : TraceViewerForm.GetImageFromImageList(Images.ListenActivity, out index)); } else if (executionColumnItem[i].CurrentActivity != null && ActivityAnalyzerHelper.IsMessageRelatedActivity(executionColumnItem[i].CurrentActivity)) { imageList = TraceViewerForm.GetImageFromImageList(Images.MessageActivityIcon, out index); if (executionColumnItem[i].CurrentActivity.ActivityType == ActivityType.UserCodeExecutionActivity) { imageList = TraceViewerForm.GetImageFromImageList(Images.ExecutionActivityIcon, out index); } else if (executionColumnItem[i].CurrentActivity.ActivityType == ActivityType.ConnectionActivity) { imageList = TraceViewerForm.GetImageFromImageList(Images.ConnectionActivityIcon, out index); } } else { imageList = TraceViewerForm.GetImageFromImageList(Images.DefaultActivityIcon, out index); } } if (index != -1 && imageList != null) { label2.ImageList = imageList; label2.ImageIndex = index; label2.ImageAlign = ContentAlignment.MiddleCenter; } else { label2.Text = SR.GetString("SL_ATitle"); } label2.BackColor = Color.Transparent; label2.DoubleClick += lblActivity_DoubleClick; label2.Tag = currentActivity; label2.Font = GetDefaultFont(currentScale); label2.BorderStyle = BorderStyle.None; label2.TextAlign = ContentAlignment.TopCenter; label2.Location = new Point(num2, GetDefaultVSize(currentScale)); label2.Size = new Size(TraceRecordCellControl.GetControlSize(currentScale).Width, GetDefaultVSize(currentScale)); SetupContextMenuForActivityTitle(label2, executionColumnItem[i], analyzer, currentScale); mainPanel.Controls.Add(label2); num2 += TraceRecordCellControl.GetControlSize(currentScale).Width + ExecutionCellControl.GetDefaultBlock(currentScale); } num2 -= ExecutionCellControl.GetDefaultBlock(currentScale) - ExecutionCellControl.GetDefaultBlank(currentScale); num2 += HorzBundRowControl.GetDefaultBlock(currentScale) + ExecutionCellControl.GetDefaultBlank(currentScale); } if (analyzer.ExecutionColumnItems.Count > 1) { num3 += HorzBundRowControl.GetDefaultBlock(currentScale) * (analyzer.ExecutionColumnItems.Count - 1); } lblDate.Font = new Font(WindowlessControlBase.CreateFont(HorzBundRowControl.GetFontSize(currentScale)), FontStyle.Bold); lblDate.Width = HorzBundRowControl.GetTimeBoxSize(currentScale).Width; lblDate.Height = GetDefaultHSize(currentScale); lblDate.Location = new Point(0, 10); container.RegisterExtentionEventListener(OnWindowlessControlExtentionEvent); base.Size = new Size(num3, GetDefaultHSize(currentScale)); } }
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); } } }