Created
July 10, 2024 21:53
-
-
Save jcouture100/b45c089aeee9e0da171c5a91208854b1 to your computer and use it in GitHub Desktop.
ScintillaNET Json Recipe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void SetStyleJson(Scintilla scintilla) | |
{ | |
// Reset the styles | |
scintilla.StyleResetDefault(); | |
// Use fixed font for Json | |
scintilla.Styles[Style.Default].Font = "Consolas"; | |
scintilla.Styles[Style.Default].Size = 11; | |
scintilla.StyleClearAll(); | |
// Add color styles | |
scintilla.Styles[Style.Json.Number].ForeColor = Color.Red; | |
scintilla.Styles[Style.Json.String].ForeColor = Color.Purple; | |
scintilla.Styles[Style.Json.PropertyName].ForeColor = Color.FromArgb(0, 102, 204); // Blue/Gray | |
scintilla.Styles[Style.Json.Keyword].ForeColor = Color.Blue; | |
// Add key words | |
scintilla.SetKeywords(0, @"null"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment