public static void UpdateRowHighlight(DataGridViewRow row, FontAndColorState colors, ReadOnlyCollection <string> watches, DataHighlightColor?changeFg = null, DataHighlightColor?changeBg = null) { var rowFg = DataHighlightColor.None; var rowBg = DataHighlightColor.None; var inactiveBg = colors.HighlightBackground[(int)DataHighlightColor.Inactive]; var watch = (string)row.Cells[VisualizerTable.NameColumnIndex].Value; var isUnevaluated = watches == null || !string.IsNullOrWhiteSpace(watch) && watch != "System" && !watches.Contains(watch); if (isUnevaluated) { row.DefaultCellStyle.BackColor = inactiveBg; return; } if (row.DefaultCellStyle.Tag is ValueTuple <DataHighlightColor, DataHighlightColor> existingColors) { (rowFg, rowBg) = existingColors; } if (changeFg is DataHighlightColor fg) { rowFg = fg; } if (changeBg is DataHighlightColor bg) { rowBg = bg; } var fgColor = rowFg != DataHighlightColor.None ? colors.HighlightForeground[(int)rowFg] : Color.Empty; var bgColor = rowBg != DataHighlightColor.None ? colors.HighlightBackground[(int)rowBg] : Color.Empty; row.DefaultCellStyle.ForeColor = fgColor; row.DefaultCellStyle.BackColor = bgColor; row.DefaultCellStyle.Tag = (rowFg, rowBg); }
public ColumnStyling(Options.VisualizerAppearance appearance, ColumnStylingOptions styling, ComputedColumnStyling computedStyling, FontAndColorState fontAndColor) { _laneDividerWidth = appearance.LaneSeparatorWidth; _hiddenColumnSeparatorWidth = appearance.HiddenColumnSeparatorWidth; _columnBackgroundColors = styling.BackgroundColors; _columnForegroundColors = styling.ForegroundColors; _computedStyling = computedStyling; _fontAndColor = fontAndColor; }
public FontAndColorProvider() { ThreadHelper.ThrowIfNotOnUIThread(); _storage = (IVsFontAndColorStorage)GetGlobalService(typeof(SVsFontAndColorStorage)); Assumes.Present(_storage); ErrorHandler.ThrowOnFailure(_storage.OpenCategory(Constants.FontAndColorsCategoryGuid, _storageFlags)); _service = (FontAndColorService)GetGlobalService(typeof(FontAndColorService)); _service.ItemsChanged += FontAndColorItemsChanged; FontAndColorState = new FontAndColorState(this); }
private void FontAndColorItemsChanged() { FontAndColorState = new FontAndColorState(this); FontAndColorInfoChanged?.Invoke(); }
public static void GrayOutRow(FontAndColorState colors, DataGridViewRow row) { row.DefaultCellStyle.BackColor = colors.HighlightBackground[(int)DataHighlightColor.Inactive]; }