我正在编写一个针对Visual Studio 2012/2013的扩展程序,并且出于性能原因,所有配置值都被缓存。
为了使“字体和颜色”中的更改实时可见,我需要知道用户何时更改了选项。
有没有办法在用户更改任何选项设置时获得通知?
目前,我有一个解决方法,在我的初始化方法中使用Windows.WindowCreated
事件:
Dispatcher.CurrentDispatcher.BeginInvoke(
new Action( () => {
DTE.Events.WindowEvents.WindowCreated += WindowEvents_WindowCreated;
} ), DispatcherPriority.ApplicationIdle, null );