CaseInsensitiveHashCodeProvider

CaseInsensitiveHashCodeProvider CF 1.0, serializable

System.Collections (mscorlib.dll) class

When this object is passed to a Hashtable constructor, it overrides the GetHashCode( ) method to allow string comparison without regard to case. If you pass an instance of this type into the Hashtable constructor, you should also pass in an instance of CaseInsensitiveComparer to ensure that any comparison operations (such as sorting) are also performed in a case-insensitive fashion. You can obtain a standard provider that uses the System.Globalization.InvariantCulture rules for generating hashcodes by using the CaseInsensitiveComparer instance returned from the static DefaultInvariant property.

 public class  CaseInsensitiveHashCodeProvider  : IHashCodeProvider {  // Public Constructors  public  CaseInsensitiveHashCodeProvider  ( );    public  CaseInsensitiveHashCodeProvider  (System.Globalization.CultureInfo   culture   );  // Public Static Properties  public static CaseInsensitiveHashCodeProvider  Default  {get; }    public static CaseInsensitiveHashCodeProvider  DefaultInvariant  {get; }  // Public Instance Methods  public int  GetHashCode  (object   obj   );  // implements IHashCodeProvider  } 


C# in a Nutshell
C # in a Nutshell, Second Edition
ISBN: 0596005261
EAN: 2147483647
Year: 2005
Pages: 963

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net