public static SolidColorBrush GetBrush(ISymbol symbol) { switch (symbol.ContainingType?.Name) { case nameof(System.Windows.SystemColors): case nameof(System.Drawing.SystemBrushes): return(NamedColorCache.GetSystemBrush(symbol.Name)); case nameof(System.Drawing.KnownColor): return(NamedColorCache.GetBrush(symbol.Name) ?? NamedColorCache.GetSystemBrush(symbol.Name)); case nameof(System.Drawing.Color): case nameof(System.Drawing.Brushes): case nameof(Colors): return(NamedColorCache.GetBrush(symbol.Name)); } return(null); }
public static SolidColorBrush GetBrush(ISymbol symbol, bool includeVsColors) { var n = symbol.ContainingType?.Name; switch (n) { case nameof(System.Windows.SystemColors): case nameof(System.Drawing.SystemBrushes): case nameof(System.Drawing.SystemPens): return(NamedColorCache.GetSystemBrush(symbol.Name)); case nameof(System.Drawing.KnownColor): return(NamedColorCache.GetBrush(symbol.Name) ?? NamedColorCache.GetSystemBrush(symbol.Name)); case nameof(System.Drawing.Color): case nameof(System.Drawing.Brushes): case nameof(System.Drawing.Pens): case nameof(Colors): return(NamedColorCache.GetBrush(symbol.Name)); } if (includeVsColors) { switch (n) { case nameof(EnvironmentColors): return(GetVsThemeBrush(typeof(EnvironmentColors), symbol.Name)); case nameof(CommonDocumentColors): return(GetVsThemeBrush(typeof(CommonDocumentColors), symbol.Name)); case nameof(CommonControlsColors): return(GetVsThemeBrush(typeof(CommonControlsColors), symbol.Name)); case nameof(InfoBarColors): return(GetVsThemeBrush(typeof(InfoBarColors), symbol.Name)); case nameof(StartPageColors): return(GetVsThemeBrush(typeof(StartPageColors), symbol.Name)); case nameof(HeaderColors): return(GetVsThemeBrush(typeof(HeaderColors), symbol.Name)); case nameof(ThemedDialogColors): return(GetVsThemeBrush(typeof(ThemedDialogColors), symbol.Name)); case nameof(ProgressBarColors): return(GetVsThemeBrush(typeof(ProgressBarColors), symbol.Name)); case nameof(SearchControlColors): return(GetVsThemeBrush(typeof(SearchControlColors), symbol.Name)); case nameof(TreeViewColors): return(GetVsThemeBrush(typeof(TreeViewColors), symbol.Name)); case nameof(VsColors): return(GetVsResourceColor(typeof(VsColors), symbol.Name)); case nameof(VsBrushes): return(GetVsResourceBrush(typeof(VsBrushes), symbol.Name)); } } return(null); }
public static SolidColorBrush GetSystemBrush(string symbolName) { return(NamedColorCache.GetSystemBrush(symbolName)); }
public static SolidColorBrush GetBrush(string color) { return(NamedColorCache.GetBrush(color)); }
public static SolidColorBrush GetBrush(string color, bool parseSystemColor) { return(NamedColorCache.GetBrush(color, parseSystemColor)); }