private nativeLastIndexOfCharOrdinalIgnoreCase ( void pNativeTextInfo, String str, Char value, int startIndex, int count ) : int | ||
pNativeTextInfo | void | |
str | String | |
value | Char | |
startIndex | int | |
count | int | |
return | int |
public virtual unsafe int LastIndexOf(string source, char value, int startIndex, int count, CompareOptions options) { if (source == null) { throw new ArgumentNullException("source"); } if ((((options & ~(CompareOptions.IgnoreWidth | CompareOptions.IgnoreKanaType | CompareOptions.IgnoreSymbols | CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase)) != CompareOptions.None) && (options != CompareOptions.Ordinal)) && (options != CompareOptions.OrdinalIgnoreCase)) { throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), "options"); } if ((source.Length == 0) && ((startIndex == -1) || (startIndex == 0))) { return(-1); } if ((startIndex < 0) || (startIndex > source.Length)) { throw new ArgumentOutOfRangeException("startIndex", Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (startIndex == source.Length) { startIndex--; if (count > 0) { count--; } } if ((count < 0) || (((startIndex - count) + 1) < 0)) { throw new ArgumentOutOfRangeException("count", Environment.GetResourceString("ArgumentOutOfRange_Count")); } if (options == CompareOptions.OrdinalIgnoreCase) { return(TextInfo.nativeLastIndexOfCharOrdinalIgnoreCase(TextInfo.InvariantNativeTextInfo, source, value, startIndex, count)); } if (!this.IsSynthetic) { return(LastIndexOfChar(this.m_pSortingTable, this.m_sortingLCID, source, value, startIndex, count, (int)options)); } if (options == CompareOptions.Ordinal) { return(LastIndexOfChar(CultureInfo.InvariantCulture.CompareInfo.m_pSortingTable, this.m_sortingLCID, source, value, startIndex, count, (int)options)); } return(this.SyntheticLastIndexOf(source, new string(value, 1), startIndex, count, GetNativeCompareFlags(options))); }