Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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);
                    }
                }
            }
        }
Ejemplo n.º 5
0
 /// <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);
 }