コード例 #1
0
 private void RefreshOptionMenuHighlightStatus()
 {
     if (!showActivityBoundaryTracesMenuItem.Checked || !showVerboseMenuItem.Checked)
     {
         optionsStripDropDown.ForeColor = Utilities.GetColor(ApplicationColors.HightlightedMenuColor);
     }
     else
     {
         optionsStripDropDown.ForeColor = SystemColors.ControlText;
     }
 }
コード例 #2
0
 private void ChangeOptionMenuStatus()
 {
     if (!showBasicsMenuItem.Checked || !showDiagMenuItem.Checked)
     {
         extensionMenu.ForeColor = Utilities.GetColor(ApplicationColors.HightlightedMenuColor);
     }
     else
     {
         extensionMenu.ForeColor = SystemColors.ControlText;
     }
 }
コード例 #3
0
 private void InitializeUI()
 {
     selectedItemBrush   = new SolidBrush(Utilities.GetColor(ApplicationColors.Highlight));
     unselectedItemBrush = new SolidBrush(Utilities.GetColor(ApplicationColors.GradientInactiveCaption));
     graphics            = DrawPanel.CreateGraphics();
     if (!string.IsNullOrEmpty(fileDescriptor.FilePath))
     {
         lblFilePath.Text = Path.GetFileName(fileDescriptor.FilePath);
         ToolTip toolTip = new ToolTip();
         toolTip.AutoPopDelay = 10000;
         toolTip.InitialDelay = 100;
         toolTip.ReshowDelay  = 100;
         toolTip.IsBalloon    = true;
         toolTip.ToolTipIcon  = ToolTipIcon.Info;
         toolTip.SetToolTip(lblFilePath, fileDescriptor.FilePath);
     }
 }
コード例 #4
0
 internal override void SetupToolbar(ToolStrip toolStrip)
 {
     if (toolStrip != null)
     {
         normalToolStripMenuItemClickHandler            = normalToolStripMenuItem_Click;
         smallToolStripMenuItemClickHandler             = smallToolStripMenuItem_Click;
         xSmallToolStripMenuItemClickHandler            = xSmallToolStripMenuItem_Click;
         showActivityBoundaryTracesMenuItemClickHandler = showActivityBoundaryTracesMenuItem_Click;
         showVerboseMenuItemClickHandler = showVerboseMenuItem_Click;
         toolStripExecutionModeByProcessMenuItemClickHandler = toolStripExecutionModeByProcessMenuItem_Click;
         toolStripExecutionModeByThreadMenuItemClickHandler  = toolStripExecutionModeByThreadMenuItem_Click;
         normalToolStripMenuItem.Click            += normalToolStripMenuItemClickHandler;
         smallToolStripMenuItem.Click             += smallToolStripMenuItemClickHandler;
         xSmallToolStripMenuItem.Click            += xSmallToolStripMenuItemClickHandler;
         showActivityBoundaryTracesMenuItem.Click += showActivityBoundaryTracesMenuItemClickHandler;
         showVerboseMenuItem.Click += showVerboseMenuItemClickHandler;
         toolStripExecutionModeByProcessMenuItem.Click += toolStripExecutionModeByProcessMenuItemClickHandler;
         toolStripExecutionModeByThreadMenuItem.Click  += toolStripExecutionModeByThreadMenuItemClickHandler;
         toolStrip.Items.AddRange(new ToolStripItem[3]
         {
             zoomStripDropDown,
             optionsStripDropDown,
             toolStripExecutionModeMenu
         });
         RefreshOptionMenuHighlightStatus();
         if (currentAnalyzer != null && currentAnalyzer.AllInvolvedExecutionItems != null && currentAnalyzer.AllInvolvedExecutionItems.Count > 1)
         {
             executionRegionsDropDown.DropDownItems.Clear();
             executionRegionsDropDown.Text        = (TraceViewerForm.IsThreadExecutionMode ? SR.GetString("SL_ProcessList2") : SR.GetString("SL_ProcessList"));
             executionRegionsDropDown.ToolTipText = (TraceViewerForm.IsThreadExecutionMode ? SR.GetString("SL_ProcessListTip2") : SR.GetString("SL_ProcessListTip"));
             List <int> list = new List <int>();
             foreach (ExecutionColumnItem executionColumnItem in currentAnalyzer.ExecutionColumnItems)
             {
                 list.Add(executionColumnItem.CurrentExecutionInfo.ExecutionID);
             }
             bool flag = false;
             foreach (ExecutionColumnItem allInvolvedExecutionItem in currentAnalyzer.AllInvolvedExecutionItems)
             {
                 ToolStripMenuItem toolStripMenuItem = new ToolStripMenuItem();
                 toolStripMenuItem.Text        = allInvolvedExecutionItem.CurrentExecutionInfo.ProcessName + (TraceViewerForm.IsThreadExecutionMode ? (SR.GetString("CF_LeftB") + allInvolvedExecutionItem.CurrentExecutionInfo.ThreadID + SR.GetString("CF_RightB")) : string.Empty);
                 toolStripMenuItem.ToolTipText = allInvolvedExecutionItem.CurrentExecutionInfo.ToString();
                 toolStripMenuItem.Checked     = (list.Contains(allInvolvedExecutionItem.CurrentExecutionInfo.ExecutionID) ? true : false);
                 if (!toolStripMenuItem.Checked)
                 {
                     flag = true;
                 }
                 toolStripMenuItem.Tag    = allInvolvedExecutionItem;
                 toolStripMenuItem.Click += ProcessListItem_Click;
                 executionRegionsDropDown.DropDownItems.Add(toolStripMenuItem);
             }
             if (flag)
             {
                 executionRegionsDropDown.ForeColor = Utilities.GetColor(ApplicationColors.HightlightedMenuColor);
             }
             else
             {
                 executionRegionsDropDown.ForeColor = SystemColors.ControlText;
             }
             toolStrip.Items.Add(executionRegionsDropDown);
         }
     }
 }
コード例 #5
0
 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));
     }
 }