private void RunCallback(PerformanceResult model) { if (InvokeRequired) { Invoke(new Action <PerformanceResult>(RunCallback), model); return; } dgvResults.DataSource = model.Result; DataGridViewHelper.MakeSortable(dgvResults); DataGridViewHelper.AutoSizeGrid(dgvResults); dgvResults.Sort(dgvResults.Columns[EventPerformanceConst.DurationTS], ListSortDirection.Descending); dgvResults.Columns[EventPerformanceConst.DurationTS].HeaderCell.SortGlyphDirection = SortOrder.Descending; dgvResults.ReadOnly = true; if (_lastSelectedEventId != -1) { dgvResults.ClearSelection(); foreach (DataGridViewRow row in dgvResults.Rows) { if (row.Cells[EventPerformanceConst.EventId].Value.ToString().Equals(_lastSelectedEventId.ToString())) { row.Selected = true; dgvResults.CurrentCell = row.Cells[0]; break; } } } lblTotalDuration.Text = $"Total Duration: {model.TotalDuration.ToReadableString()}"; lblTotalEvents.Text = $"Total Events: {model.TotalEvents}"; btnEditEvent.Enabled = true; StatusPanel.StatusUpdate(StatusModel.Completed); }
private void RenderCriteriaMatches(CriteriaMatchModel model) { try { dgvCriteria.SuspendLayout(); dgvCriteria.DataSource = model.Matches; dgvCriteria.Columns[0].ReadOnly = true; DataGridViewHelper.AutoSizeGrid(dgvCriteria); if (model.DateTimeDifference != null) { lblDateTimeDifference.Text = model.DateTimeDifference.ToString(); } foreach ( var row in dgvCriteria.Rows.Cast <DataGridViewRow>() .Where(row => Convert.ToBoolean(row.Cells["IsMatch"].Value) == false)) { row.DefaultCellStyle.BackColor = Color.Red; if (row.Selected) { row.DefaultCellStyle.SelectionBackColor = Color.Magenta; } } } finally { dgvCriteria.ResumeLayout(); } }
public void Render(ResearchCacheData model) { dgvResearch.DataSource = model.Items.OrderBy(n => n.Name).ToList(); DataGridViewHelper.AutoSizeGrid(dgvResearch); DataGridViewHelper.MakeSortable(dgvResearch); RenderView(); StatusUpdate(StatusModel.Completed); }
public void Render(PerformanceData model) { if (InvokeRequired) { Invoke(new Action <PerformanceData>(Render), model); return; } dgvPerformanceEvents.DataSource = model.Items.OrderByDescending(n => n.StartTime).ToList(); DataGridViewHelper.AutoSizeGrid(dgvPerformanceEvents); DataGridViewHelper.MakeSortable(dgvPerformanceEvents); StatusUpdate(StatusModel.Completed); }
public MonitorScriptIDE() { InitializeComponent(); UICommon.SetDoubleBuffered(this); DataGridViewHelper.AutoSizeGrid(dgvResults); CurrentViewState = ViewState.Summary; // Default dgvResults.Dock = DockStyle.Fill; tvResults.Dock = DockStyle.Fill; pnlSummary.Dock = DockStyle.Fill; HandleDestroyed += MonitorScriptIDE_HandleDestroyed; ViewOptions(); }
private void RenderTargetValues(NetworkMessageInfo msg) { try { dgvTargetProperties.SuspendLayout(); dgvTargetProperties.DataSource = msg.Source.Values; DataGridViewHelper.AutoSizeGrid(dgvTargetProperties); } finally { dgvTargetProperties.ResumeLayout(); } tsslTargetValueCount.Text = string.Format("Count {0}", msg.Source.Values.Count()); }
private void RenderSourceValues(NetworkMessageInfo msg) { try { dgvSourceProperties.ResumeLayout(); dgvSourceProperties.DataSource = msg.Source.Values; scValues.SplitterDistance = scValues.Width / 2; DataGridViewHelper.AutoSizeGrid(dgvSourceProperties); } finally { dgvSourceProperties.ResumeLayout(); } tsslSourceValueCount.Text = string.Format("Count {0}", msg.Source.Values.Count()); }
public void Render(ValueCacheData model) { dgvValues.DataSource = model.Values .Where(n => (!ckbFilter.Checked || ( UICommon.WhereCheckListBox(clbSourceType, n.SourceTypes) && UICommon.WhereCheckListBox(clbCategory, n.Categories) && UICommon.WhereText(tbName, n.Name) && UICommon.WhereText(tbRegularExpression, n.Expression) && UICommon.WhereCheck(ckbLazyLoad, n.LazyLoad) && UICommon.WhereCheck(ckbDocumentMap, n.DocumentMap) && UICommon.WhereCheck(ckbDistinct, n.Distinct) && UICommon.WhereCheck(ckbFileInfo, n.FileInfo) ) ) ) .OrderBy(n => n.Name).ToList(); DataGridViewHelper.AutoSizeGrid(dgvValues); DataGridViewHelper.MakeSortable(dgvValues); RenderView(); StatusUpdate(StatusModel.Completed); }
public void Render(EventCacheData model) { // Note: Invoke is handled by ViewModelBase - Sara dgvEvents.DataSource = model.Events.OrderBy(n => n.Name).ToList(); dgvEvents.DataSource = model.Events .Where(n => (!ckbFilter.Checked || ( UICommon.WhereCheckListBox(clbSourceType, n.SourceTypes) && UICommon.WhereCheckListBox(clbCategory, n.Categories) && UICommon.WhereText(tbName, n.Name) && UICommon.WhereText(tbRegularExpression, n.RegularExpression) && UICommon.WhereCheck(ckbDocumentMap, n.DocumentMap) ) ) ) .OrderBy(n => n.Name).ToList(); DataGridViewHelper.AutoSizeGrid(dgvEvents); RenderView(); StatusUpdate(StatusModel.Completed); }