We need you! We're working hard on the next version of Developer Fusion -
Let us know what you think we should be up to!
-
Expand
Microsoft.Win32
-
Expand
Microsoft.Win32.SafeHandles
-
Expand
System
-
Expand
System.Runtime.Hosting
-
Expand
System.Runtime.InteropServices
-
Expand
System.Runtime.CompilerServices
-
Expand
System.Collections
-
Expand
System.Collections.Generic
-
Expand
System.Collections.ObjectModel
-
Expand
System.Configuration.Assemblies
-
Expand
System.Diagnostics
-
Expand
System.Diagnostics.CodeAnalysis
-
Expand
System.Diagnostics.SymbolStore
-
Expand
System.Globalization
-
Expand
__DateBuffer
-
Expand
BaseInfoTable
-
Expand
BidiCategory
-
Expand
Calendar
-
Expand
CalendarAlgorithmType
-
Expand
CalendarId
-
Expand
CalendarTable
-
Expand
CalendarTableData
-
Expand
CalendarWeekRule
-
Expand
CharUnicodeInfo
-
Expand
ChineseLunisolarCalendar
-
Expand
CodePageDataItem
-
Expand
CompareInfo
-
ClearDefaultAssemblyCache()
-
Compare(string, int, int, string, int, int)
-
Compare(string, int, int, string, int, int, CompareOptions)
-
Compare(string, int, string, int)
-
Compare(string, int, string, int, CompareOptions)
-
Compare(string, string)
-
Compare(string, string, CompareOptions)
-
Compare(void, int, string, string, CompareOptions)
-
CompareInfo(GlobalizationAssembly, int)
-
CompareRegion(void, int, string, int, int, string, int, int, CompareOptions)
-
CultureTableRecord()
-
Equals(object)
-
GetCompareInfo(int)
-
GetCompareInfo(int, Assembly)
-
GetCompareInfo(string)
-
GetCompareInfo(string, Assembly)
-
GetCompareInfoByName(string, Assembly)
-
GetHashCode()
-
GetHashCodeOfString(string, CompareOptions)
-
GetSortingLCID(int)
-
GetSortKey(string)
-
GetSortKey(string, CompareOptions)
-
IndexOf(string, char)
-
IndexOf(string, char, CompareOptions)
-
IndexOf(string, char, int)
-
IndexOf(string, char, int, CompareOptions)
-
IndexOf(string, char, int, int)
-
IndexOf(string, char, int, int, CompareOptions)
-
IndexOf(string, string)
-
IndexOf(string, string, CompareOptions)
-
IndexOf(string, string, int)
-
IndexOf(string, string, int, CompareOptions)
-
IndexOf(string, string, int, int)
-
IndexOf(string, string, int, int, CompareOptions)
-
IndexOfChar(void, int, string, char, int, int, int)
-
IndexOfString(void, int, string, string, int, int, int)
-
InitializeCompareInfo(void, int)
-
InternalSyncObject()
-
IsPrefix(string, string)
-
IsPrefix(string, string, CompareOptions)
-
IsSortable(char)
-
IsSortable(string)
-
IsSuffix(string, string)
-
IsSuffix(string, string, CompareOptions)
-
IsSynthetic()
-
LastIndexOf(string, char)
-
LastIndexOf(string, char, CompareOptions)
-
LastIndexOf(string, char, int)
-
LastIndexOf(string, char, int, CompareOptions)
-
LastIndexOf(string, char, int, int)
-
LastIndexOf(string, char, int, int, CompareOptions)
-
LastIndexOf(string, string)
-
LastIndexOf(string, string, CompareOptions)
-
LastIndexOf(string, string, int)
-
LastIndexOf(string, string, int, CompareOptions)
-
LastIndexOf(string, string, int, int)
-
LastIndexOf(string, string, int, int, CompareOptions)
-
LastIndexOfChar(void, int, string, char, int, int, int)
-
LastIndexOfString(void, int, string, string, int, int, int)
-
LCID()
-
Name()
-
nativeCompareString(int, string, int, int, string, int, int, int)
-
nativeCreateSortKey(void, string, int, int)
-
nativeGetGlobalizedHashCode(void, string, int, int)
-
nativeIsPrefix(void, int, string, string, CompareOptions)
-
nativeIsSortable(void, string)
-
nativeIsSuffix(void, int, string, string, CompareOptions)
-
OnDeserialized()
-
OnDeserialized(StreamingContext)
-
OnDeserializing(StreamingContext)
-
OnSerializing(StreamingContext)
-
SetName(string)
-
ToString()
-
Expand
CompareOptions
-
Expand
CultureData
-
Expand
CultureFlags
-
Expand
CultureInfo
-
Expand
CultureNameOffsetItem
-
Expand
CultureTable
-
Expand
CultureTableData
-
Expand
CultureTableHeader
-
Expand
CultureTableItem
-
Expand
CultureTableRecord
-
Expand
CultureTypes
-
Expand
DateMapping
-
Expand
DateTimeFormatFlags
-
Expand
DateTimeFormatInfo
-
Expand
DateTimeFormatInfoScanner
-
Expand
DateTimeStyles
-
Expand
DaylightTime
-
Expand
DigitShapes
-
Expand
DigitValues
-
Expand
DTFIUserOverrideValues
-
Expand
EastAsianLunisolarCalendar
-
Expand
EncodingTable
-
Expand
EndianessHeader
-
Expand
EraInfo
-
Expand
ExceptionTableItem
-
Expand
FORMATFLAGS
-
Expand
FoundDatePattern
-
Expand
GlobalizationAssembly
-
Expand
GregorianCalendar
-
Expand
GregorianCalendarHelper
-
Expand
GregorianCalendarTypes
-
Expand
HebrewCalendar
-
Expand
HebrewNumber
-
Expand
HebrewNumberParsingContext
-
Expand
HebrewNumberParsingState
-
Expand
HebrewToken
-
Expand
HebrewValue
-
Expand
HijriCalendar
-
Expand
HS
-
Expand
IdnMapping
-
Expand
IDOffsetItem
-
Expand
IetfNameOffsetItem
-
Expand
InternalCodePageDataItem
-
Expand
InternalEncodingDataItem
-
Expand
JapaneseCalendar
-
Expand
JapaneseLunisolarCalendar
-
Expand
JulianCalendar
-
Expand
KoreanCalendar
-
Expand
KoreanLunisolarCalendar
-
Expand
MemoryMapFile
-
Expand
MonthNameStyles
-
Expand
NumberFormatInfo
-
Expand
NumberStyles
-
Expand
PersianCalendar
-
Expand
RegionInfo
-
Expand
RegionNameOffsetItem
-
Expand
SortKey
-
Expand
StringInfo
-
Expand
TaiwanCalendar
-
Expand
TaiwanLunisolarCalendar
-
Expand
TextElementEnumerator
-
Expand
TextInfo
-
Expand
TextInfoDataHeader
-
Expand
ThaiBuddhistCalendar
-
Expand
TokenHashValue
-
Expand
UmAlQuraCalendar
-
Expand
UnicodeCategory
-
Expand
UnicodeDataHeader
-
Expand
System.IO
-
Expand
System.IO.IsolatedStorage
-
Expand
System.Reflection
-
Expand
System.Reflection.Cache
-
Expand
System.Reflection.Emit
-
Expand
System.Resources
-
Expand
System.Runtime
-
Expand
System.Runtime.InteropServices.Expando
-
Expand
System.Runtime.ConstrainedExecution
-
Expand
System.Runtime.Remoting.Activation
-
Expand
System.Runtime.Remoting.Messaging
-
Expand
System.Runtime.Remoting.Channels
-
Expand
System.Runtime.Remoting.Lifetime
-
Expand
System.Runtime.Remoting
-
Expand
System.Runtime.Remoting.Contexts
-
Expand
System.Runtime.Remoting.Proxies
-
Expand
System.Runtime.Remoting.Metadata
-
Expand
System.Runtime.Remoting.Metadata.W3cXsd2001
-
Expand
System.Runtime.Remoting.Services
-
Expand
System.Runtime.Serialization
-
Expand
System.Runtime.Serialization.Formatters
-
Expand
System.Runtime.Serialization.Formatters.Binary
-
Expand
System.Runtime.Versioning
-
Expand
System.Security
-
Expand
System.Security.Cryptography
-
Expand
System.Security.Cryptography.X509Certificates
-
Expand
System.Security.Permissions
-
Expand
System.Security.Policy
-
Expand
System.Security.Principal
-
Expand
System.Security.Util
-
Expand
System.Text
-
Expand
System.Threading
-
Expand
System.Runtime.Remoting.Channels.Http
-
Expand
System.Runtime.Remoting.Channels.Tcp
-
Expand
System.Runtime.Remoting.MetadataServices
-
Expand
System.Runtime.Serialization.Formatters.Soap.Xml
-
Expand
System.Runtime.Serialization.Formatters.Soap
-
Expand
Microsoft.Tools.Caspol
-
Expand
Microsoft.Tools.Build
-
Expand
Microsoft.CSharp
-
Expand
System.CodeDom
-
Expand
System.CodeDom.Compiler
-
Expand
System.Collections.Specialized
-
Expand
System.ComponentModel
-
Expand
System.ComponentModel.Design
-
Expand
System.ComponentModel.Design.Serialization
-
Expand
System.Configuration
-
Expand
System.Web
-
Expand
System.Configuration.Provider
-
Expand
System.Configuration.Internal
-
Expand
System.Internal
-
Expand
System.Windows.Forms
-
Expand
System.Net
-
Expand
System.Net.Sockets
-
Expand
System.Net.NetworkInformation
-
Expand
System.Net.ComImports
-
Expand
System.Net.Security
-
Expand
System.Net.Cache
-
Expand
System.Net.Configuration
-
Expand
System.Text.RegularExpressions
-
Expand
System.Tools
-
Expand
System.IO.Compression
-
Expand
System.IO.Ports
-
Expand
System.Security.AccessControl
-
Expand
System.Xml
-
Expand
System.Xml.XPath.DataBinding
-
Expand
System.Xml.Schema
-
Expand
System.Xml.Serialization
-
Expand
System.Xml.Serialization.Advanced
-
Expand
System.Xml.Serialization.Configuration
-
Expand
System.Xml.XPath
-
Expand
System.Xml.Xsl
-
Expand
System.Xml.Xsl.IlGen
-
Expand
System.Xml.Xsl.Qil
-
Expand
System.Xml.Xsl.Runtime
-
Expand
System.Xml.Xsl.XPath
-
Expand
System.Xml.Xsl.Xslt
-
Expand
System.Xml.Xsl.XsltOld
-
Expand
System.Xml.Xsl.XsltOld.Debugger
-
Expand
Microsoft.JScript
-
Expand
Microsoft.Vsa
-
Expand
Microsoft.JScript.Vsa
- ////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////
- namespace System.Globalization
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
- using System;
- using System.Collections;
- using System.Reflection;
- using System.Runtime.Serialization;
- using System.Runtime.CompilerServices;
- using System.Runtime.ConstrainedExecution;
- using System.Threading;
- using System.Security.Permissions;
- using System.Runtime.InteropServices;
- using Microsoft.Win32;
-
-
-
-
-
-
-
-
-
- [Flags(), Serializable()]
- [System.Runtime.InteropServices.ComVisible(true)]
- public enum CompareOptions
- {
-
- None = 0,
-
- IgnoreCase = 1,
-
- IgnoreNonSpace = 2,
-
- IgnoreSymbols = 4,
-
- IgnoreKanaType = 8,
-
- IgnoreWidth = 16,
-
- OrdinalIgnoreCase = 268435456,
-
- StringSort = 536870912,
-
- Ordinal = 1073741824
-
-
-
-
-
- }
-
-
- [Serializable()]
- [System.Runtime.InteropServices.ComVisible(true)]
- public class CompareInfo : IDeserializationCallback
- {
-
-
- private const CompareOptions ValidIndexMaskOffFlags = ~(CompareOptions.IgnoreCase | CompareOptions.IgnoreSymbols | CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreWidth | CompareOptions.IgnoreKanaType);
-
- private const CompareOptions ValidCompareMaskOffFlags = ~(CompareOptions.IgnoreCase | CompareOptions.IgnoreSymbols | CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreWidth | CompareOptions.IgnoreKanaType | CompareOptions.StringSort);
-
- private const CompareOptions ValidHashCodeOfStringMaskOffFlags = ~(CompareOptions.IgnoreCase | CompareOptions.IgnoreSymbols | CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreWidth | CompareOptions.IgnoreKanaType);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe static internal extern byte[] nativeCreateSortKey(void* pSortingFile, string pString, int dwFlags, int win32LCID);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe static internal extern int nativeGetGlobalizedHashCode(void* pSortingFile, string pString, int dwFlags, int win32LCID);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe static internal extern bool nativeIsSortable(void* pSortingFile, string pString);
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern int nativeCompareString(int lcid, string string1, int offset1, int length1, string string2, int offset2, int length2, int flags);
-
- private static object s_InternalSyncObject;
- private static object InternalSyncObject {
- get {
- if (s_InternalSyncObject == null) {
- object o = new object();
- Interlocked.CompareExchange(ref s_InternalSyncObject, o, null);
- }
- return s_InternalSyncObject;
- }
- }
-
-
-
-
-
-
- public static CompareInfo GetCompareInfo(int culture, Assembly assembly)
- {
-
- if (assembly == null) {
- throw new ArgumentNullException("assembly");
- }
-
- if (CultureTableRecord.IsCustomCultureId(culture)) {
-
- throw new ArgumentException(Environment.GetResourceString("Argument_CustomCultureCannotBePassedByNumber", "culture"));
- }
- if (assembly != typeof(object).Module.Assembly) {
- throw new ArgumentException(Environment.GetResourceString("Argument_OnlyMscorlib"));
- }
-
-
-
- GlobalizationAssembly ga = GlobalizationAssembly.GetGlobalizationAssembly(assembly);
- object compInfo = ga.compareInfoCache[culture];
- if (compInfo == null) {
- lock (InternalSyncObject) {
-
-
-
-
- if ((compInfo = ga.compareInfoCache[culture]) == null) {
- compInfo = new CompareInfo(ga, culture);
- System.Threading.Thread.MemoryBarrier();
- ga.compareInfoCache[culture] = compInfo;
- }
- }
- }
-
- return ((CompareInfo)compInfo);
- }
-
-
-
-
-
-
-
- private const int TraditionalChineseCultureId = 31748;
- private const int HongKongCultureId = 3076;
-
- private static CompareInfo GetCompareInfoByName(string name, Assembly assembly)
- {
- CultureInfo cultureInfo = CultureInfo.GetCultureInfo(name);
- if (cultureInfo.IsNeutralCulture && !CultureTableRecord.IsCustomCultureId(cultureInfo.cultureID)) {
- if (cultureInfo.cultureID == TraditionalChineseCultureId)
- cultureInfo = CultureInfo.GetCultureInfo(HongKongCultureId);
- else
- cultureInfo = CultureInfo.GetCultureInfo(cultureInfo.CompareInfoId);
- }
-
- CompareInfo compareInfo;
-
- if (assembly != null)
- compareInfo = GetCompareInfo(cultureInfo.CompareInfoId, assembly);
- else
- compareInfo = GetCompareInfo(cultureInfo.CompareInfoId);
-
-
- compareInfo.m_name = cultureInfo.SortName;
-
- return compareInfo;
- }
-
-
-
-
- public static CompareInfo GetCompareInfo(string name, Assembly assembly)
- {
- if (name == null || assembly == null) {
- throw new ArgumentNullException(name == null ? "name" : "assembly");
- }
-
- if (assembly != typeof(object).Module.Assembly) {
- throw new ArgumentException(Environment.GetResourceString("Argument_OnlyMscorlib"));
- }
-
- return GetCompareInfoByName(name, assembly);
- }
-
-
-
- public static CompareInfo GetCompareInfo(int culture)
- {
-
- if (CultureTableRecord.IsCustomCultureId(culture)) {
-
- throw new ArgumentException(Environment.GetResourceString("Argument_CustomCultureCannotBePassedByNumber", "culture"));
- }
-
-
- object compInfo = GlobalizationAssembly.DefaultInstance.compareInfoCache[culture];
- if (compInfo == null) {
- lock (InternalSyncObject) {
-
-
-
-
- if ((compInfo = GlobalizationAssembly.DefaultInstance.compareInfoCache[culture]) == null) {
- compInfo = new CompareInfo(GlobalizationAssembly.DefaultInstance, culture);
- System.Threading.Thread.MemoryBarrier();
- GlobalizationAssembly.DefaultInstance.compareInfoCache[culture] = compInfo;
- }
- }
- }
- return ((CompareInfo)compInfo);
- }
-
-
-
- public static CompareInfo GetCompareInfo(string name)
- {
- if (name == null) {
- throw new ArgumentNullException("name");
- }
-
- return GetCompareInfoByName(name, null);
- }
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public static bool IsSortable(char ch)
- {
- return (IsSortable(ch.ToString()));
- }
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public static bool IsSortable(string text)
- {
- if (text == null) {
-
- throw new ArgumentNullException("text");
- }
-
- if (0 == text.Length) {
-
- return (false);
- }
-
- unsafe {
- return (nativeIsSortable(CultureInfo.InvariantCulture.CompareInfo.m_pSortingTable, text));
- }
- }
-
- #region Serialization
- private int win32LCID;
-
- private int culture;
-
- [OnDeserializing()]
- private void OnDeserializing(StreamingContext ctx)
- {
- this.culture = -1;
- this.m_sortingLCID = -1;
- }
-
- unsafe private void OnDeserialized()
- {
- BCLDebug.Assert(this.culture >= 0, "[CompareInfo.OnDeserialized] - culture >= 0");
-
-
- if (m_sortingLCID <= 0) {
- m_sortingLCID = GetSortingLCID(this.culture);
- }
- if (m_pSortingTable == null && !IsSynthetic) {
- m_pSortingTable = InitializeCompareInfo(GlobalizationAssembly.DefaultInstance.pNativeGlobalizationAssembly, this.m_sortingLCID);
- }
- BCLDebug.Assert(IsSynthetic || m_pSortingTable != null, "m_pSortingTable != null");
-
- }
-
-
- [OnDeserialized()]
- private void OnDeserialized(StreamingContext ctx)
- {
- OnDeserialized();
- }
-
- [OnSerializing()]
- private void OnSerializing(StreamingContext ctx)
- {
- win32LCID = m_sortingLCID;
- }
- #endregion Serialization
-
- ///////////////////////////----- Name -----/////////////////////////////////
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public virtual string Name {
- get {
- if (m_name == null) {
- m_name = CultureInfo.GetCultureInfo(culture).SortName;
- }
-
- return (m_name);
- }
- }
-
- internal void SetName(string name)
- {
- m_name = name;
- }
-
- static internal void ClearDefaultAssemblyCache()
- {
- lock (InternalSyncObject) {
- GlobalizationAssembly.DefaultInstance.compareInfoCache = new Hashtable(4);
- }
- }
-
-
- internal CultureTableRecord CultureTableRecord {
- get {
- if (m_cultureTableRecord == null) {
- m_cultureTableRecord = CultureInfo.GetCultureInfo(this.m_sortingLCID).m_cultureTableRecord;
- }
-
- return m_cultureTableRecord;
- }
- }
-
-
- private bool IsSynthetic {
- get { return CultureTableRecord.IsSynthetic; }
- }
-
-
-
-
- [NonSerialized()]
- unsafe internal void* m_pSortingTable;
- [NonSerialized()]
- private int m_sortingLCID;
-
- [NonSerialized()]
- private CultureTableRecord m_cultureTableRecord;
-
- [OptionalField(VersionAdded = 2)]
- private string m_name = null;
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
- unsafe internal CompareInfo(GlobalizationAssembly ga, int culture)
- {
- if (culture < 0) {
- throw new ArgumentOutOfRangeException("culture", Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
- }
-
- this.m_sortingLCID = GetSortingLCID(culture);
-
-
-
-
-
-
-
- if (!IsSynthetic) {
- m_pSortingTable = InitializeCompareInfo(GlobalizationAssembly.DefaultInstance.pNativeGlobalizationAssembly, this.m_sortingLCID);
- }
-
- this.culture = culture;
-
- }
-
-
- internal int GetSortingLCID(int culture)
- {
- int sortingLCID = 0;
-
-
-
- CultureInfo cultureObj = CultureInfo.GetCultureInfo(culture);
-
-
- sortingLCID = cultureObj.CompareInfoId;
-
- int sortID = CultureInfo.GetSortID(culture);
- if (sortID != 0) {
-
- if (!cultureObj.m_cultureTableRecord.IsValidSortID(sortID)) {
- throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_CultureNotSupported"), culture), "culture");
- }
-
- sortingLCID |= sortID << 16;
- }
- return (sortingLCID);
-
- }
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public virtual int Compare(string string1, string string2)
- {
- return (Compare(string1, string2, CompareOptions.None));
- }
-
-
- unsafe public virtual int Compare(string string1, string string2, CompareOptions options)
- {
-
- if (options == CompareOptions.OrdinalIgnoreCase) {
- return String.Compare(string1, string2, StringComparison.OrdinalIgnoreCase);
- }
-
-
- if ((options & CompareOptions.Ordinal) != 0) {
- if (options == CompareOptions.Ordinal) {
-
-
- if (string1 == null) {
- if (string2 == null) {
- return (0);
-
- }
- return (-1);
-
- }
- if (string2 == null) {
- return (1);
-
- }
-
- return String.nativeCompareOrdinal(string1, string2, false);
- }
- else {
- throw new ArgumentException(Environment.GetResourceString("Argument_CompareOptionOrdinal"), "options");
- }
- }
- if ((options & ValidCompareMaskOffFlags) != 0) {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), "options");
- }
-
-
-
- if (string1 == null) {
- if (string2 == null) {
- return (0);
-
- }
- return (-1);
-
- }
- if (string2 == null) {
- return (1);
-
- }
-
-
- return (Compare(m_pSortingTable, this.m_sortingLCID, string1, string2, options));
- }
-
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe private static extern int Compare(void* pSortingTable, int sortingLCID, string string1, string string2, CompareOptions options);
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- unsafe public virtual int Compare(string string1, int offset1, int length1, string string2, int offset2, int length2)
- {
- return Compare(string1, offset1, length1, string2, offset2, length2, 0);
- }
-
-
- unsafe public virtual int Compare(string string1, int offset1, string string2, int offset2, CompareOptions options)
- {
- return Compare(string1, offset1, string1 == null ? 0 : string1.Length - offset1, string2, offset2, string2 == null ? 0 : string2.Length - offset2, options);
- }
-
-
- unsafe public virtual int Compare(string string1, int offset1, string string2, int offset2)
- {
- return Compare(string1, offset1, string2, offset2, 0);
- }
-
-
- unsafe public virtual int Compare(string string1, int offset1, int length1, string string2, int offset2, int length2, CompareOptions options)
- {
- if (options == CompareOptions.OrdinalIgnoreCase) {
- int result = String.Compare(string1, offset1, string2, offset2, length1 < length2 ? length1 : length2, StringComparison.OrdinalIgnoreCase);
- if ((length1 != length2) && result == 0)
- return (length1 > length2 ? 1 : -1);
- return (result);
- }
-
-
- if (length1 < 0 || length2 < 0) {
- throw new ArgumentOutOfRangeException((length1 < 0) ? "length1" : "length2", Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
- }
- if (offset1 < 0 || offset2 < 0) {
- throw new ArgumentOutOfRangeException((offset1 < 0) ? "offset1" : "offset2", Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
- }
- if (offset1 > (string1 == null ? 0 : string1.Length) - length1) {
- throw new ArgumentOutOfRangeException("string1", Environment.GetResourceString("ArgumentOutOfRange_OffsetLength"));
- }
- if (offset2 > (string2 == null ? 0 : string2.Length) - length2) {
- throw new ArgumentOutOfRangeException("string2", Environment.GetResourceString("ArgumentOutOfRange_OffsetLength"));
- }
- if ((options & CompareOptions.Ordinal) != 0) {
- if (options == CompareOptions.Ordinal) {
-
-
-
- if (string1 == null) {
- if (string2 == null) {
- return (0);
- }
- return (-1);
- }
- if (string2 == null) {
- return (1);
- }
-
- int result = String.nativeCompareOrdinalEx(string1, offset1, string2, offset2, (length1 < length2 ? length1 : length2));
- if ((length1 != length2) && result == 0) {
- return (length1 > length2 ? 1 : -1);
- }
- return (result);
- }
- else {
- throw new ArgumentException(Environment.GetResourceString("Argument_CompareOptionOrdinal"), "options");
- }
- }
- if ((options & ValidCompareMaskOffFlags) != 0) {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), "options");
- }
-
-
-
-
- if (string1 == null) {
- if (string2 == null) {
- return (0);
- }
- return (-1);
- }
- if (string2 == null) {
- return (1);
- }
-
-
-
- return (CompareRegion(m_pSortingTable, this.m_sortingLCID, string1, offset1, length1, string2, offset2, length2, options));
- }
-
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe private static extern int CompareRegion(void* pSortingTable, int sortingLCID, string string1, int offset1, int length1, string string2, int offset2, int length2, CompareOptions options);
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- unsafe public virtual bool IsPrefix(string source, string prefix, CompareOptions options)
- {
- if (source == null || prefix == null) {
- throw new ArgumentNullException((source == null ? "source" : "prefix"), Environment.GetResourceString("ArgumentNull_String"));
- }
- int prefixLen = prefix.Length;
-
- if (prefixLen == 0) {
- return (true);
- }
-
- if (options == CompareOptions.OrdinalIgnoreCase) {
- return source.StartsWith(prefix, StringComparison.OrdinalIgnoreCase);
- }
-
- if ((options & ValidIndexMaskOffFlags) != 0 && (options != CompareOptions.Ordinal)) {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), "options");
- }
-
-
- return (nativeIsPrefix(m_pSortingTable, this.m_sortingLCID, source, prefix, options));
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe private static extern bool nativeIsPrefix(void* pSortingTable, int sortingLCID, string source, string prefix, CompareOptions options);
-
-
- public virtual bool IsPrefix(string source, string prefix)
- {
- return (IsPrefix(source, prefix, 0));
- }
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- unsafe public virtual bool IsSuffix(string source, string suffix, CompareOptions options)
- {
- if (source == null || suffix == null) {
- throw new ArgumentNullException((source == null ? "source" : "suffix"), Environment.GetResourceString("ArgumentNull_String"));
- }
- int suffixLen = suffix.Length;
-
- if (suffixLen == 0) {
- return (true);
- }
-
- if (options == CompareOptions.OrdinalIgnoreCase) {
- return source.EndsWith(suffix, StringComparison.OrdinalIgnoreCase);
- }
-
- if ((options & ValidIndexMaskOffFlags) != 0 && (options != CompareOptions.Ordinal)) {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), "options");
- }
-
-
- return (nativeIsSuffix(m_pSortingTable, this.m_sortingLCID, source, suffix, options));
- }
-
-
- public virtual bool IsSuffix(string source, string suffix)
- {
- return (IsSuffix(source, suffix, 0));
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe private static extern bool nativeIsSuffix(void* pSortingTable, int sortingLCID, string source, string prefix, CompareOptions options);
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- unsafe public virtual int IndexOf(string source, char value)
- {
- if (source == null)
- throw new ArgumentNullException("source");
-
- return IndexOf(source, value, 0, source.Length, CompareOptions.None);
- }
-
-
- unsafe public virtual int IndexOf(string source, string value)
- {
- if (source == null)
- throw new ArgumentNullException("source");
-
- return IndexOf(source, value, 0, source.Length, CompareOptions.None);
- }
-
-
- unsafe public virtual int IndexOf(string source, char value, CompareOptions options)
- {
- if (source == null)
- throw new ArgumentNullException("source");
-
- return IndexOf(source, value, 0, source.Length, options);
- }
-
-
- unsafe public virtual int IndexOf(string source, string value, CompareOptions options)
- {
- if (source == null)
- throw new ArgumentNullException("source");
-
- return IndexOf(source, value, 0, source.Length, options);
- }
-
-
- unsafe public virtual int IndexOf(string source, char value, int startIndex)
- {
- if (source == null)
- throw new ArgumentNullException("source");
-
- return IndexOf(source, value, startIndex, source.Length - startIndex, CompareOptions.None);
- }
-
-
- unsafe public virtual int IndexOf(string source, string value, int startIndex)
- {
- if (source == null)
- throw new ArgumentNullException("source");
-
- return IndexOf(source, value, startIndex, source.Length - startIndex, CompareOptions.None);
- }
-
-
- unsafe public virtual int IndexOf(string source, char value, int startIndex, CompareOptions options)
- {
- if (source == null)
- throw new ArgumentNullException("source");
-
- return IndexOf(source, value, startIndex, source.Length - startIndex, options);
- }
-
-
- unsafe public virtual int IndexOf(string source, string value, int startIndex, CompareOptions options)
- {
- if (source == null)
- throw new ArgumentNullException("source");
-
- return IndexOf(source, value, startIndex, source.Length - startIndex, options);
- }
-
-
- unsafe public virtual int IndexOf(string source, char value, int startIndex, int count)
- {
- return IndexOf(source, value, startIndex, count, CompareOptions.None);
- }
-
-
- unsafe public virtual int IndexOf(string source, string value, int startIndex, int count)
- {
- return IndexOf(source, value, startIndex, count, CompareOptions.None);
- }
-
-
- unsafe public virtual int IndexOf(string source, char value, int startIndex, int count, CompareOptions options)
- {
-
- if (source == null)
- throw new ArgumentNullException("source");
-
- if (startIndex < 0 || startIndex > source.Length)
- throw new ArgumentOutOfRangeException("startIndex", Environment.GetResourceString("ArgumentOutOfRange_Index"));
-
- if (count < 0 || startIndex > source.Length - count)
- throw new ArgumentOutOfRangeException("count", Environment.GetResourceString("ArgumentOutOfRange_Count"));
-
- if (options == CompareOptions.OrdinalIgnoreCase) {
- return TextInfo.nativeIndexOfCharOrdinalIgnoreCase(TextInfo.InvariantNativeTextInfo, source, value, startIndex, count);
- }
-
-
-
- if ((options & ValidIndexMaskOffFlags) != 0 && (options != CompareOptions.Ordinal))
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), "options");
-
-
- return IndexOfChar(m_pSortingTable, this.m_sortingLCID, source, value, startIndex, count, (int)options);
- }
-
-
- unsafe public virtual int IndexOf(string source, string value, int startIndex, int count, CompareOptions options)
- {
-
- if (source == null)
- throw new ArgumentNullException("source");
- if (value == null)
- throw new ArgumentNullException("value");
-
- if (startIndex > source.Length) {
- throw new ArgumentOutOfRangeException("startIndex", Environment.GetResourceString("ArgumentOutOfRange_Index"));
- }
-
- if (source.Length == 0) {
- if (value.Length == 0) {
- return 0;
- }
- return -1;
- }
-
- if (startIndex < 0) {
- throw new ArgumentOutOfRangeException("startIndex", Environment.GetResourceString("ArgumentOutOfRange_Index"));
- }
-
- if (count < 0 || startIndex > source.Length - count)
- throw new ArgumentOutOfRangeException("count", Environment.GetResourceString("ArgumentOutOfRange_Count"));
-
- if (options == CompareOptions.OrdinalIgnoreCase) {
- return TextInfo.IndexOfStringOrdinalIgnoreCase(source, value, startIndex, count);
- }
-
-
-
- if ((options & ValidIndexMaskOffFlags) != 0 && (options != CompareOptions.Ordinal))
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), "options");
-
-
- return IndexOfString(m_pSortingTable, this.m_sortingLCID, source, value, startIndex, count, (int)options);
- }
-
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe private static extern int IndexOfChar(void* pSortingTable, int sortingLCID, string source, char value, int startIndex, int count, int options);
-
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe private static extern int IndexOfString(void* pSortingTable, int sortingLCID, string source, string value, int startIndex, int count, int options);
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- unsafe public virtual int LastIndexOf(string source, char value)
- {
- if (source == null)
- throw new ArgumentNullException("source");
-
-
- return LastIndexOf(source, value, source.Length - 1, source.Length, CompareOptions.None);
- }
-
-
- unsafe public virtual int LastIndexOf(string source, string value)
- {
- if (source == null)
- throw new ArgumentNullException("source");
-
-
- return LastIndexOf(source, value, source.Length - 1, source.Length, CompareOptions.None);
- }
-
-
- unsafe public virtual int LastIndexOf(string source, char value, CompareOptions options)
- {
- if (source == null)
- throw new ArgumentNullException("source");
-
-
- return LastIndexOf(source, value, source.Length - 1, source.Length, options);
- }
-
- unsafe public virtual int LastIndexOf(string source, string value, CompareOptions options)
- {
- if (source == null)
- throw new ArgumentNullException("source");
-
-
- return LastIndexOf(source, value, source.Length - 1, source.Length, options);
- }
-
-
- unsafe public virtual int LastIndexOf(string source, char value, int startIndex)
- {
- return LastIndexOf(source, value, startIndex, startIndex + 1, CompareOptions.None);
- }
-
-
- unsafe public virtual int LastIndexOf(string source, string value, int startIndex)
- {
- return LastIndexOf(source, value, startIndex, startIndex + 1, CompareOptions.None);
- }
-
-
- unsafe public virtual int LastIndexOf(string source, char value, int startIndex, CompareOptions options)
- {
- return LastIndexOf(source, value, startIndex, startIndex + 1, options);
- }
-
-
- unsafe public virtual int LastIndexOf(string source, string value, int startIndex, CompareOptions options)
- {
- return LastIndexOf(source, value, startIndex, startIndex + 1, options);
- }
-
-
- unsafe public virtual int LastIndexOf(string source, char value, int startIndex, int count)
- {
- return LastIndexOf(source, value, startIndex, count, CompareOptions.None);
- }
-
-
- unsafe public virtual int LastIndexOf(string source, string value, int startIndex, int count)
- {
- return LastIndexOf(source, value, startIndex, count, CompareOptions.None);
- }
-
-
- unsafe public virtual int LastIndexOf(string source, char value, int startIndex, int count, CompareOptions options)
- {
-
- if (source == null)
- throw new ArgumentNullException("source");
-
-
-
- if ((options & ValidIndexMaskOffFlags) != 0 && (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);
- }
-
-
- return (LastIndexOfChar(m_pSortingTable, this.m_sortingLCID, source, value, startIndex, count, (int)options));
- }
-
-
- unsafe public virtual int LastIndexOf(string source, string value, int startIndex, int count, CompareOptions options)
- {
-
- if (source == null)
- throw new ArgumentNullException("source");
- if (value == null)
- throw new ArgumentNullException("value");
-
-
-
- if ((options & ValidIndexMaskOffFlags) != 0 && (options != CompareOptions.Ordinal) && (options != CompareOptions.OrdinalIgnoreCase))
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), "options");
-
-
- if (source.Length == 0 && (startIndex == -1 || startIndex == 0))
- return (value.Length == 0) ? 0 : -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 (value.Length == 0 && count >= 0 && startIndex - count + 1 >= 0)
- return startIndex;
- }
-
-
- if (count < 0 || startIndex - count + 1 < 0)
- throw new ArgumentOutOfRangeException("count", Environment.GetResourceString("ArgumentOutOfRange_Count"));
-
- if (options == CompareOptions.OrdinalIgnoreCase) {
- return TextInfo.LastIndexOfStringOrdinalIgnoreCase(source, value, startIndex, count);
- }
-
-
- return (LastIndexOfString(m_pSortingTable, this.m_sortingLCID, source, value, startIndex, count, (int)options));
- }
-
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe static internal extern int LastIndexOfChar(void* pSortingTable, int sortingLCID, string source, char value, int startIndex, int count, int options);
-
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe static internal extern int LastIndexOfString(void* pSortingTable, int sortingLCID, string source, string value, int startIndex, int count, int options);
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- unsafe public virtual SortKey GetSortKey(string source, CompareOptions options)
- {
-
-
-
- return (new SortKey(m_pSortingTable, this.m_sortingLCID, source, options));
- }
-
-
- unsafe public virtual SortKey GetSortKey(string source)
- {
-
-
-
- return (new SortKey(m_pSortingTable, this.m_sortingLCID, source, CompareOptions.None));
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public override bool Equals(object value)
- {
- CompareInfo that = value as CompareInfo;
-
- if (that != null) {
- return this.m_sortingLCID == that.m_sortingLCID && this.Name.Equals(that.Name);
- }
-
- return (false);
- }
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public override int GetHashCode()
- {
- return (this.Name.GetHashCode());
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
- unsafe internal int GetHashCodeOfString(string source, CompareOptions options)
- {
-
-
-
- if (null == source) {
- throw new ArgumentNullException("source");
- }
-
- if ((options & ValidHashCodeOfStringMaskOffFlags) != 0) {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), "options");
- }
-
- if (0 == source.Length) {
- return (0);
- }
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- return (nativeGetGlobalizedHashCode(m_pSortingTable, source, (int)options, this.m_sortingLCID));
- }
-
- ////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
- ////////////////////////////////////////////////////////////////////////
-
-
- public override string ToString()
- {
- return ("CompareInfo - " + this.culture);
- }
-
-
- public int LCID {
- get { return (this.culture); }
- }
-
-
-
-
-
-
- unsafe private static void* InitializeCompareInfo(void* pNativeGlobalizationAssembly, int sortingLCID)
- {
- }
-
- void* pTemp = null;
-
- bool tookLock = false;
- }
- }