c# - Properties.Settings 是否被缓存?

标签 c# .net wpf winforms

出于性能原因,我考虑将 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.

https://learn.microsoft.com/en-us/dotnet/api/system.configuration.applicationsettingsbase.reload?view=netframework-4.8

关于c# - Properties.Settings 是否被缓存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56792218/

相关文章:

c# - 配置持久层时出现异常

.net - 获取 PEM 公钥和私钥或从 PFX 文件

.net - User.Settings 文件在 ClickOnce 更新时恢复值

wpf - 在 wpf 中如何处理由使用该用户控件的页面中的用户控件内的按钮引发的事件

wpf - 公开依赖项属性

c# - 我应该如何将用户与域对象相关联?

C# WPF - 如何将 TextBox Enter 键按下绑定(bind)到方法?

c# - 如何跳过 DevExpress ColumnView 的 CellValueChanging 状态?

.net - 如何创建虚拟 Windows 驱动器

wpf - 如何使用动画笔划粗细动态调整矩形路径的大小?