In a Visual Studio extension I have defined a VSPackage with a number of commands in it. In the handler for one of the commands, I set a user setting using the following code:
SettingsManager settingsManager = new ShellSettingsManager(this);
WritableSettingsStore userSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);
userSettingsStore.SetBoolean("Text Editor", "Visible Whitespace", true);
This successfully sets the value in the registry (at HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0Exp\Text Editor
in the case of the isolated shell), but the editor does not automatically get notified of the change, i.e. the white space remains hidden. Also the menu option at Edit > Advanced > Show White Space remains toggled off. Restarting Visual Studio picks up the change.
How can I tell Visual Studio to refresh the state of its user settings so that everything else gets notified of the change?