CaseInsensitiveHashCodeProvider Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Caution
CaseInsensitiveHashCodeProvider has been deprecated. Use StringComparer instead.
Caution
Please use StringComparer instead.
Supplies a hash code for an object, using a hashing algorithm that ignores the case of strings.
public ref class CaseInsensitiveHashCodeProvider : System::Collections::IHashCodeProvider
[System.Obsolete("CaseInsensitiveHashCodeProvider has been deprecated. Use StringComparer instead.")]
public class CaseInsensitiveHashCodeProvider : System.Collections.IHashCodeProvider
[System.Obsolete("Please use StringComparer instead.")]
public class CaseInsensitiveHashCodeProvider : System.Collections.IHashCodeProvider
[System.Serializable]
public class CaseInsensitiveHashCodeProvider : System.Collections.IHashCodeProvider
[System.Obsolete("Please use StringComparer instead.")]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class CaseInsensitiveHashCodeProvider : System.Collections.IHashCodeProvider
[<System.Obsolete("CaseInsensitiveHashCodeProvider has been deprecated. Use StringComparer instead.")>]
type CaseInsensitiveHashCodeProvider = class
interface IHashCodeProvider
[<System.Obsolete("Please use StringComparer instead.")>]
type CaseInsensitiveHashCodeProvider = class
interface IHashCodeProvider
[<System.Serializable>]
type CaseInsensitiveHashCodeProvider = class
interface IHashCodeProvider
[<System.Obsolete("Please use StringComparer instead.")>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type CaseInsensitiveHashCodeProvider = class
interface IHashCodeProvider
Public Class CaseInsensitiveHashCodeProvider
Implements IHashCodeProvider
- Inheritance
-
CaseInsensitiveHashCodeProvider
- Attributes
- Implements
Remarks
CaseInsensitiveHashCodeProvider implements the IHashCodeProvider interface supporting case-insensitive comparisons on strings, just as CaseInsensitiveComparer implements the IComparer interface supporting case-insensitive comparisons on strings.
Important
We don't recommend that you use the CaseInsensitiveHashCodeProvider
class for new development. Instead, we recommend that you use the System.StringComparer object returned by the StringComparer.CurrentCultureIgnoreCase, StringComparer.InvariantCultureIgnoreCase, or StringComparer.OrdinalIgnoreCase property.
The objects used as keys by a Hashtable are required to override the Object.GetHashCode method (or the IHashCodeProvider interface) and the Object.Equals method (or the IComparer interface). The implementation of both methods or interfaces must handle case sensitivity the same way; otherwise, the Hashtable might behave incorrectly. For example, when creating a Hashtable, you must use this class with the CaseInsensitiveComparer class or any case-insensitive IComparer implementation.
Constructors
CaseInsensitiveHashCodeProvider() |
Initializes a new instance of the CaseInsensitiveHashCodeProvider class using the CurrentCulture of the current thread. |
CaseInsensitiveHashCodeProvider(CultureInfo) |
Initializes a new instance of the CaseInsensitiveHashCodeProvider class using the specified CultureInfo. |
Properties
Default |
Gets an instance of CaseInsensitiveHashCodeProvider that is associated with the CurrentCulture of the current thread and that is always available. |
DefaultInvariant |
Gets an instance of CaseInsensitiveHashCodeProvider that is associated with InvariantCulture and that is always available. |
Methods
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetHashCode(Object) |
Returns a hash code for the given object, using a hashing algorithm that ignores the case of strings. |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |