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; }
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; }