CultureInfo.UseUserOverride 属性

定义

获取一个值,该值指示当前 CultureInfo 对象是否使用用户选定的区域性设置。Gets a value indicating whether the current CultureInfo object uses the user-selected culture settings.

public:
 property bool UseUserOverride { bool get(); };
public bool UseUserOverride { get; }
member this.UseUserOverride : bool
Public ReadOnly Property UseUserOverride As Boolean

属性值

如果当前 true 使用用户选定的区域性设置,则为 CultureInfo;否则为 falsetrue if the current CultureInfo uses the user-selected culture settings; otherwise, false.

注解

用户可以选择通过 "控制面板" 的 "区域和语言选项" 部分,替代与 Windows 的当前区域性关联的某些值。The user might choose to override some of the values associated with the current culture of Windows through the regional and language options portion of Control Panel. 例如,用户可以选择以不同的格式显示日期,或使用区域性默认值以外的其他货币。For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture.

如果 UseUserOverride true 并且指定的区域性与 Windows 的当前区域性匹配,则 CultureInfo 将使用这些重写,其中包括 DateTimeFormat 属性返回的 DateTimeFormatInfo 实例的属性的用户设置,以及 NumberFormatInfo 属性返回的 NumberFormat 实例的属性。If UseUserOverride is true and the specified culture matches the current culture of Windows, the CultureInfo uses those overrides, including user settings for the properties of the DateTimeFormatInfo instance returned by the DateTimeFormat property, and the properties of the NumberFormatInfo instance returned by the NumberFormat property. 如果用户设置与 CultureInfo关联的区域性不兼容(例如,如果所选日历不是 OptionalCalendars之一),则方法的结果和属性的值是不确定的。If the user settings are incompatible with the culture associated with the CultureInfo, for example, if the selected calendar is not one of the OptionalCalendars, the results of the methods and the values of the properties are undefined.

此属性在创建 CultureInfo 时设置。This property is set when the CultureInfo is created.

适用于