Monitor a VS Setting for Changes? #347
Answered
by
CalvinAllen
CalvinAllen
asked this question in
Q&A
-
Somewhat related to my last question about finding out the status of the "Code Lens" setting(s), is it possible to MONITOR one of the VS settings for changes? We do this for our own settings with a NotifyPropertyChanged, but is there anyway to do that for a VS setting - like the CodeLens option? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
CalvinAllen
Jun 8, 2022
Replies: 1 comment
-
Well, answered my own question. For the next unfortunate soul - [Guid("9B164E40-C3A2-4363-9BC5-EB4039DEF653")]
private class SVsSettingsPersistenceManager { }
public VisualStudioSettingsManager([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider){
_settingsManager = serviceProvider.GetService(typeof(SVsSettingsPersistenceManager)) as ISettingsManager;
var setting = _roamingSettingsManager.GetSubset("TextEditorGlobalOptions.IsCodeLensEnabled");
setting.SettingChangedAsync += (sender, args) => {
// Do something
return Task.CompletedTask;
};
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
CalvinAllen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well, answered my own question. For the next unfortunate soul -