private static SolidColorBrush GetBackgroundBrush() { var highlightBackgroundColor = Settings.Default.HighlightBackgroundColor; if (highlightBackgroundColor.IsNamedColor && highlightBackgroundColor.Name.Equals("Transparent")) { return(ColorHelper.ToBrush(EnvironmentColors.AccessKeyToolTipDisabledTextColorKey)); } return(ColorHelper.ToBrush(highlightBackgroundColor)); }
public static void SetBookmarkStyles(CodeDocumentViewModel codeDocumentViewModel, ControlCollection controls, string solutionFilePath) { var styles = new List <BookmarkStyle>(); foreach (var item in controls) { var label = item as Label; styles.Add(new BookmarkStyle(ColorHelper.ToBrush(label.BackColor), ColorHelper.ToBrush(label.ForeColor))); } codeDocumentViewModel.BookmarkStyles = styles; SolutionStorageHelper.SaveToSolutionStorage(solutionFilePath, codeDocumentViewModel); }
public static void HighlightCurrentItem(Window window, CodeDocumentViewModel codeDocumentViewModel) { try { if (!(window?.Selection is TextSelection)) { return; } } catch (Exception) { return; } HighlightCurrentItem(codeDocumentViewModel, ((TextSelection)window.Selection).CurrentLine, ColorHelper.ToBrush(EnvironmentColors.ToolWindowTabSelectedTextColorKey), GetBackgroundBrush(), ColorHelper.ToBrush(EnvironmentColors.FileTabButtonDownSelectedActiveColorKey), ColorHelper.ToBrush(EnvironmentColors.ToolWindowTextColorKey)); }
public static void SetForeground(IEnumerable <CodeItem> items) { if (items == null) { return; } foreach (var item in items) { item.Foreground = ColorHelper.ToBrush(EnvironmentColors.ToolWindowTextColorKey); if (item is IMembers) { var hasMembersItem = (IMembers)item; if (hasMembersItem.Members.Any()) { SetForeground(hasMembersItem.Members); } } } }
/// <summary> /// Revert code item foreground and background to previous state /// </summary> /// <param name="codeItem">code item</param> public static void ClearBookmark(CodeItem codeItem) { codeItem.Background = Brushes.Transparent; codeItem.Foreground = ColorHelper.ToBrush(EnvironmentColors.ToolWindowTextColorKey); }