Пример #1
0
        private Brush GetBrushForCurrentTheme(ThemeBrushTarget target)
        {
            var attribute = this.SyntaxHighlightingStyle.GetAttributes <AssociatedThemeBrushAttribute>()
                            .FirstOrDefault(x => (x.AssociatedTheme == this.ApplicationTheme || x.AssociatedTheme == ApplicationTheme.Any) &&
                                            x.Target == target);

            return(attribute?.AssociatedBrush ?? new SolidColorBrush(Colors.Red));
        }
Пример #2
0
 public AssociatedThemeBrushAttribute(ApplicationTheme associatedTheme, ThemeBrushTarget target, string associatedBrush)
 {
     this.AssociatedBrush = (SolidColorBrush)new BrushConverter().ConvertFromString(associatedBrush);
       this.AssociatedTheme = associatedTheme;
       this.Target = target;
 }
Пример #3
0
 public AssociatedThemeBrushAttribute(ApplicationTheme associatedTheme, ThemeBrushTarget target, Brush associatedBrush)
 {
     this.AssociatedBrush = associatedBrush;
       this.AssociatedTheme = associatedTheme;
       this.Target = target;
 }
Пример #4
0
        private Brush GetBrushForCurrentTheme(ThemeBrushTarget target)
        {
            var attribute = this.SyntaxHighlightingStyle.GetAttributes<AssociatedThemeBrushAttribute>()
             .FirstOrDefault(x => (x.AssociatedTheme == this.ApplicationTheme || x.AssociatedTheme == ApplicationTheme.Any)
                              && x.Target == target);

              return attribute?.AssociatedBrush ?? new SolidColorBrush(Colors.Red);
        }
Пример #5
0
 public AssociatedThemeBrushAttribute(ApplicationTheme associatedTheme, ThemeBrushTarget target, string associatedBrush)
 {
     this.AssociatedBrush = (SolidColorBrush) new BrushConverter().ConvertFromString(associatedBrush);
     this.AssociatedTheme = associatedTheme;
     this.Target          = target;
 }
Пример #6
0
 public AssociatedThemeBrushAttribute(ApplicationTheme associatedTheme, ThemeBrushTarget target, Brush associatedBrush)
 {
     this.AssociatedBrush = associatedBrush;
     this.AssociatedTheme = associatedTheme;
     this.Target          = target;
 }