Ejemplo n.º 1
0
        void SetupThreadGridPanel()
        {
            var panel = this.uxThreadGridPanel;

            panel.Dock = DockStyle.Fill;
            panel.ApplyColorSet(this.colorSet);
            panel.AutoGenerateColumns = true;

            panel.DataSource    = this.threadList;
            panel.KeyColumnName = nameof(ThreadEntry.Tid);

            this.uxUpperSplitContainer.Panel2.Controls.Add(panel);

            panel.SetAllColumnWidth(this.kGridPanelDefaultColumnWidth);
            panel.SetDefaultCellStyle();
            panel.Columns[nameof(ThreadViewData.Priority)].Width      = this.kGridPanelNarrowColumnWidth;
            panel.Columns[nameof(ThreadViewData.Cpu)].Width           = this.kGridPanelNarrowColumnWidth;
            panel.Columns[nameof(ThreadViewData.CpuPeak)].Width       = this.kGridPanelNarrowColumnWidth;
            panel.Columns[nameof(ThreadViewData.CpuPeak)].ToolTipText = $"Peak CPU usage (%) for the last {this.kTopIntervalSeconds * this.kCpuPeakRange} seconds.";
            panel.Columns[nameof(ThreadViewData.Name)].AutoSizeMode   = DataGridViewAutoSizeColumnMode.Fill;

            var cpuCellPainter = new GridPanel.NumericCellPaintData()
            {
                Type       = GridPanel.CellPaintType.Fill,
                PaintColor = this.kCpuCellPaintColor,
                MinValue   = this.kCpuCellPaintValueMin,
                MaxValue   = this.kCpuCellPaintValueMax
            };

            panel.Columns[nameof(ThreadViewData.Cpu)].Tag     = cpuCellPainter;
            panel.Columns[nameof(ThreadViewData.CpuPeak)].Tag = cpuCellPainter;

            // デフォルトはCPU使用率の降順
            panel.SortColumn(panel.Columns[nameof(ThreadViewData.Cpu)], ListSortDirection.Descending);
        }
Ejemplo n.º 2
0
        void SetupProcessGridPanel()
        {
            var panel = this.uxProcessGridPanel;

            panel.Dock = DockStyle.Fill;
            panel.ApplyColorSet(this.colorSet);
            panel.DataSource    = this.processList;
            panel.KeyColumnName = nameof(ProcessViewData.Pid);

            panel.SuppressibleSelectionChanged += this.ProcessGridPanel_SuppressibleSelectionChanged;

            this.uxUpperSplitContainer.Panel1.Controls.Add(panel);

            panel.SetAllColumnWidth(this.kGridPanelDefaultColumnWidth);
            panel.SetDefaultCellStyle();
            //panel.Columns[nameof(ProcessViewData.Vss)].DefaultCellStyle.Format = "#,0";
            //panel.Columns[nameof(ProcessViewData.Rss)].DefaultCellStyle.Format = "#,0";
            panel.Columns[nameof(ProcessViewData.Priority)].Width      = this.kGridPanelNarrowColumnWidth;
            panel.Columns[nameof(ProcessViewData.Cpu)].Width           = this.kGridPanelNarrowColumnWidth;
            panel.Columns[nameof(ProcessViewData.CpuPeak)].Width       = this.kGridPanelNarrowColumnWidth;
            panel.Columns[nameof(ProcessViewData.ThreadCount)].Width   = this.kGridPanelNarrowColumnWidth;
            panel.Columns[nameof(ProcessViewData.CpuPeak)].ToolTipText = $"Peak CPU usage (%) for the last {this.kTopIntervalSeconds * this.kCpuPeakRange} seconds.";
            panel.Columns[nameof(ProcessViewData.Name)].AutoSizeMode   = DataGridViewAutoSizeColumnMode.Fill;

            var cpuCellPainter = new GridPanel.NumericCellPaintData()
            {
                Type       = GridPanel.CellPaintType.Fill,
                PaintColor = this.kCpuCellPaintColor,
                MinValue   = this.kCpuCellPaintValueMin,
                MaxValue   = this.kCpuCellPaintValueMax
            };

            panel.Columns[nameof(ProcessViewData.Cpu)].Tag     = cpuCellPainter;
            panel.Columns[nameof(ProcessViewData.CpuPeak)].Tag = cpuCellPainter;

            // デフォルトはCPU使用率の降順
            panel.SortColumn(panel.Columns[nameof(ProcessViewData.Cpu)], ListSortDirection.Descending);
        }