出于性能原因,我考虑将 Properties.Settings
读入字段,然后使用这些字段,因为 Properties.Settings uses reflection但是,也许这些值已被缓存,因此没有意义。
那么,Properties.Settings 是否被缓存?
最佳答案
ApplicationSettingsBase.Reload
方法文档的
备注部分涉及缓存。
The Reload method clears the currently cached property values, causing a reload of these values from persistent storage when they are subsequently accessed. This method performs the following actions:
- It clears the currently cached properties by clearing the collection represented by the PropertyValues property.
- It raises the PropertyChanged event for every member of the Properties collection.
Reload contrasts with Reset in that the former will load the last set of saved application settings values, whereas the latter will load the saved default values.
关于c# - Properties.Settings 是否被缓存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56792218/