protected override void PrepareCellStyle(string colName, Connection job, C1Style cellStyle) { if (colName == nameof(Connection.Status) && job.Status == ConnectionStatus.Connected) { cellStyle.Color = C1Color.Green; } }
protected override void PrepareCellStyle(string colName, Job job, C1Style cellStyle) { switch (colName) { case nameof(Job.Errors): cellStyle.BackgroundColor = job.Errors > 0 ? C1Color.Red : C1Color.Green; break; case nameof(Job.Status): cellStyle.BackgroundColor = job.Status switch { ExecutionStatus.Failed => C1Color.Red, ExecutionStatus.Running => C1Color.LightGreen, ExecutionStatus.Waiting => C1Color.LightBlue, ExecutionStatus.Executed => C1Color.Green, _ => cellStyle.BackgroundColor }; break; } } }
protected override void PrepareCellStyle(string colName, Script job, C1Style cellStyle) { }
public override void PrepareCellStyle(GridCellType cellType, GridCellRange range, C1Style style) { base.PrepareCellStyle(cellType, range, style); if (cellType != GridCellType.Cell) { return; } var item = (T)Grid.Rows[range.Row].DataItem; string colName = Grid.Columns[range.Column].Binding; if (colName == nameof(ICheckable.Checked)) { if (item.Checked) { style.BackgroundColor = C1Color.Gray; } return; } PrepareCellStyle(colName, item, style); }
protected abstract void PrepareCellStyle(string colName, T job, C1Style cellStyle);
protected override void PrepareCellStyle(string colName, Connection job, C1Style cellStyle) { }
protected override void PrepareCellStyle(string colName, DataCapture job, C1Style cellStyle) { }
protected override void PrepareCellStyle(string colName, NatsMessage job, C1Style cellStyle) { }