Khi tôi dịch ngược phương pháp String.IndexOf (String)
, tôi thấy điều này;Thuộc tính String.LegacyMode là gì?
[__DynamicallyInvokable]
public int IndexOf(string value)
{
return this.IndexOf(value, string.LegacyMode ? StringComparison.Ordinal : StringComparison.CurrentCulture);
}
Trong định nghĩa tham số thứ hai:
- nếu
string.LegacyMode
làtrue
,StringComparison.Ordinal
được đánh giá. - nếu
string.LegacyMode
làfalse
,StringComparison.CurrentCulture
được đánh giá.
Nhưng String.LegacyMode
chính xác là gì?
Khi tôi biên soạn lại tài sản này, tôi thấy điều này:
internal static bool LegacyMode
{
get
{
return CompatibilitySwitches.IsAppEarlierThanSilverlight4;
}
}
Tôi tìm kiếm về String.LegacyMode và CompatibilitySwitches.IsAppEarlierThanSilverlight4 trên Google đầu tiên nhưng tôi không thể tìm thấy bất kỳ thông tin hữu ích.
Bạn có thể khai sáng cho tôi không?
@Downvoter quan tâm để nhận xét ít nhất? –