Пример #1
0
        /// <summary>
        /// Converts <paramref name="self"/> to a <see cref="HighlightingColor"/> instance or null
        /// if input is null
        /// </summary>
        /// <param name="self">This</param>
        /// <returns></returns>
        public static HighlightingColor ToHighlightingColor(this IThemeColor self)
        {
            if (self == null)
            {
                return(null);
            }
            var hl = new HighlightingColor {
                Name       = self.Name,
                FontWeight = self.FontWeight,
                FontStyle  = self.FontStyle,
                Underline  = null,
                Foreground = MyHighlightingBrush.Create(self.Foreground),
                Background = MyHighlightingBrush.Create(self.Background),
            };

            hl.Freeze();
            return(hl);
        }
Пример #2
0
 /// <summary>
 /// Creates a <see cref="HighlightingBrush"/> or returns null if input is null
 /// </summary>
 /// <param name="brush">Brush</param>
 /// <returns></returns>
 public static HighlightingBrush ToHighlightingBrush(this Brush brush)
 {
     return(MyHighlightingBrush.Create(brush));
 }