예제 #1
0
        private HighlightStyle LoadStyle(string name, string colorName, bool loadFormat, bool loadStartEndChars)
        {
            HighlightStyle result = new HighlightStyle();
            if (loadFormat)
                result.FontFormat = (WSFontFormat)GetInt(name + "Format");

            ColorPair cp = new ColorPair();
            cp.Foreground = ColorTranslator.FromOle(GetInt(colorName + "Colour"));
            cp.Background = ColorTranslator.FromOle(GetInt(colorName + "BackgroundColour"));
            cp.EnsureTextIsDarkOnLightNotLightOnDark();

            result.SetBrushes(cp);

            if (loadStartEndChars)
            {
                result.StartChar = (char)(short)GetInt(name + "SurroundStart");
                result.EndChar = (char)(short)GetInt(name + "SurroundEnd");
            }
            return result;
        }
예제 #2
0
 internal void SetBrushes(ColorPair cp)
 {
     ForegroundBrush = MakeBrush(cp.Foreground);
     if (cp.Background != Colors.White)
         BackgroundBrush = MakeBrush(cp.Background);
 }
예제 #3
0
        private HighlightStyle LoadStyleChangeLabel()
        {
            HighlightStyle result = new HighlightStyle();
            ColorPair cp = new ColorPair();
            cp.Foreground = ColorTranslator.FromOle(GetInt("StyleChangedLabelColour"));
            cp.Background = Colors.White;
            cp.EnsureTextIsDarkOnLightNotLightOnDark();
            result.SetBrushes(cp);

            return result;
        }