
public static class ActiproService
{
private static bool isDarkThemeActive;
public static bool GetIsDarkThemeActive() => ThemeManager.IsDarkTheme(ThemeManager.CurrentTheme);
public static void Initialize()
{
ThemeManager.CurrentThemeChanged += (sender, args) =>
{
UpdateHighlightingStyleRegistryForThemeChange();
};
ThemeManager.AreNativeThemesEnabled = true;
AmbientParseRequestDispatcherProvider.Dispatcher = new ThreadedParseRequestDispatcher();
var cachePath = Path.GetFullPath("Package Repository");
AmbientPackageRepositoryProvider.Repository = new FileBasedPackageRepository(cachePath);
}
public static void SetTheme(string themeName)
{
ThemeManager.BeginUpdate();
try
{
ThemeManager.UnregisterAutomaticThemes();
ThemeManager.CurrentTheme = themeName;
}
finally
{
ThemeManager.EndUpdate();
}
}
public static void UpdateHighlightingStyleRegistryForThemeChange()
{
var oldIsDarkThemeActive = isDarkThemeActive;
isDarkThemeActive = GetIsDarkThemeActive();
if (isDarkThemeActive != oldIsDarkThemeActive)
{
var classificationTypes = AmbientHighlightingStyleRegistry.Instance.ClassificationTypes.ToArray();
foreach (var classificationType in classificationTypes)
{
AmbientHighlightingStyleRegistry.Instance.Unregister(classificationType);
}
new DisplayItemClassificationTypeProvider().RegisterAll();
new PythonClassificationTypeProvider().RegisterAll();
}
}
}
protected override void OnStartup(StartupEventArgs e)
{
ActiproService.Initialize();
ActiproService.SetTheme(ThemeNames.Dark);
base.OnStartup(e);
}
I am using SyntaxEditor as a PropertyEditor in PropertyGrid.
When using Dark Theme, the ForeColor of the string in double quotation marks is the same as Light Theme, so it is hard to see. (Please check the screenshot)
The attached code is the code that I set Actipro, and there is no code that sets Theme or any color in other codes.
I need a way to solve this problem or a way to display all the strings in white (or black).