Skip to content

Instantly share code, notes, and snippets.

@sniffdk
Created October 24, 2012 21:43
Show Gist options
  • Save sniffdk/3949104 to your computer and use it in GitHub Desktop.
Save sniffdk/3949104 to your computer and use it in GitHub Desktop.
Legacy strings
public int LastIndexOf(string value)
{
return this.LastIndexOf(value, this.Length - 1, this.Length, string.LegacyMode ? StringComparison.Ordinal : StringComparison.CurrentCulture);
}
// What is LegacyMode ?
internal static bool LegacyMode
{
get
{
return CompatibilitySwitches.IsAppEarlierThanSilverlight4;
}
}
// Ohh alright, I see ..
public static bool IsAppEarlierThanSilverlight4
{
[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] get
{
return false;
}
}
// wait.... WAT?! Did I miss something .. ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment