ISettingsManager.GetValueOrDefault<T>(String, T) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回属性的值; 如果未设置该值,则返回默认值。
template <typename T>
T GetValueOrDefault(std::wstring const & name, T defaultValue = null);
public T GetValueOrDefault<T> (string name, T defaultValue = default);
abstract member GetValueOrDefault : string * 'T -> 'T
Public Function GetValueOrDefault(Of T) (name As String, Optional defaultValue As T = Nothing) As T
类型参数
- T
设置的类型。
参数
- name
- String
设置的名称。
- defaultValue
- T
默认值。
返回
- T
返回 ISettingsSubset。
例外
当 name 为 null 时引发。
当 name 为空时引发。