﻿<?xml version="1.0" encoding="utf-8"?><Type Name="Comparer" FullName="System.Collections.Comparer" FullNameSP="System_Collections_Comparer" Maintainer="ecma"><TypeSignature Language="ILASM" Value=".class public sealed serializable Comparer extends System.Object implements System.Collections.IComparer" /><TypeSignature Language="C#" Value="public sealed class Comparer : System.Collections.IComparer, System.Runtime.Serialization.ISerializable" /><TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed beforefieldinit Comparer extends System.Object implements class System.Collections.IComparer, class System.Runtime.Serialization.ISerializable" /><MemberOfLibrary>BCL</MemberOfLibrary><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement><Base><BaseTypeName>System.Object</BaseTypeName></Base><Interfaces><Interface><InterfaceName>System.Collections.IComparer</InterfaceName></Interface><Interface><InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName></Interface></Interfaces><Attributes><Attribute><AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName></Attribute></Attributes><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>This class is the default implementation of the <see cref="T:System.Collections.IComparer" /> interface. The <see cref="T:System.Collections.CaseInsensitiveComparer" /> class is the implementation of the <see cref="T:System.Collections.IComparer" /> interface that performs case-insensitive string comparisons.</para><para>Comparison procedures use the <see cref="P:System.Threading.Thread.CurrentCulture" /> of the current thread unless otherwise specified. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the <see cref="N:System.Globalization" /> namespace and <format type="text/html"><a href="9a59696b-d89b-45bd-946d-c75da4732d02">Encoding and Localization</a></format>.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Compares two objects for equivalence, where string comparisons are case-sensitive.</para></summary></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public Comparer (System.Globalization.CultureInfo culture);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Globalization.CultureInfo culture) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="culture" Type="System.Globalization.CultureInfo" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>Comparison procedures use the specified <see cref="T:System.Globalization.CultureInfo" /> to determine the sort order and casing rules. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the <see cref="N:System.Globalization" /> namespace and <format type="text/html"><a href="9a59696b-d89b-45bd-946d-c75da4732d02">Encoding and Localization</a></format>.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.Collections.Comparer" /> class using the specified <see cref="T:System.Globalization.CultureInfo" />.</para></summary><param name="culture"><attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Globalization.CultureInfo" /> to use for the new <see cref="T:System.Collections.Comparer" />. </param></Docs></Member><Member MemberName="Compare"><MemberSignature Language="ILASM" Value=".method public final hidebysig virtual int32 Compare(object a, object b)" /><MemberSignature Language="C#" Value="public int Compare (object a, object b);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance int32 Compare(object a, object b) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Int32</ReturnType></ReturnValue><Parameters><Parameter Name="a" Type="System.Object" /><Parameter Name="b" Type="System.Object" /></Parameters><Docs><exception cref="T:System.ArgumentException"><para>Both <paramref name="a" /> and <paramref name="b" /> are not <see langword="null" /> and do not implement the <see cref="T:System.IComparable" /> interface.</para><para> -or-</para><para>Both <paramref name="a" /> and <paramref name="b" /> are not <see langword="null" /> and are not assignment-compatible types.</para></exception><param name="a"><attribution license="cc4" from="Microsoft" modified="false" />The first object to compare. </param><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>If <paramref name="a" /> implements <see cref="T:System.IComparable" />, then <paramref name="a" />. CompareTo (<paramref name="b" />) is returned; otherwise, if <paramref name="b" /> implements <see cref="T:System.IComparable" />, then the negated result of <paramref name="b" />. CompareTo (<paramref name="a" />) is returned.</para><para>Comparing null with any type is allowed and does not generate an exception when using <see cref="T:System.IComparable" />. When sorting, null is considered to be less than any other object.</para><para>String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the <see cref="N:System.Globalization" /> namespace and <format type="text/html"><a href="9a59696b-d89b-45bd-946d-c75da4732d02">Encoding and Localization</a></format>.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Performs a case-sensitive comparison of two objects of the same type and returns a value indicating whether one is less than, equal to, or greater than the other.</para></summary><returns><attribution license="cc4" from="Microsoft" modified="false" /><para>A signed integer that indicates the relative values of <paramref name="a" /> and <paramref name="b" />, as shown in the following table.</para><list type="table"><listheader><item><term><para>Value </para></term><description><para>Meaning </para></description></item></listheader><item><term><para>Less than zero </para></term><description><para><paramref name="a" /> is less than <paramref name="b" />. </para></description></item><item><term><para>Zero </para></term><description><para><paramref name="a" /> equals <paramref name="b" />. </para></description></item><item><term><para>Greater than zero </para></term><description><para><paramref name="a" /> is greater than <paramref name="b" />. </para></description></item></list></returns><param name="a"><attribution license="cc4" from="Microsoft" modified="false" />The first object to compare. </param><param name="b"><attribution license="cc4" from="Microsoft" modified="false" />The second object to compare. </param></Docs><Excluded>0</Excluded></Member><Member MemberName="Default"><MemberSignature Language="ILASM" Value=".field public static initOnly class System.Collections.Comparer Default" /><MemberSignature Language="C#" Value="public static readonly System.Collections.Comparer Default;" /><MemberSignature Language="ILAsm" Value=".field public static initonly class System.Collections.Comparer Default" /><MemberType>Field</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Collections.Comparer</ReturnType></ReturnValue><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>Comparison procedures use the <see cref="P:System.Threading.Thread.CurrentCulture" /> of the current thread to determine the sort order and casing rules. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the <see cref="N:System.Globalization" /> namespace and <format type="text/html"><a href="9a59696b-d89b-45bd-946d-c75da4732d02">Encoding and Localization</a></format>.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Represents an instance of <see cref="T:System.Collections.Comparer" /> that is associated with the <see cref="P:System.Threading.Thread.CurrentCulture" /> of the current thread. This field is read-only.</para></summary></Docs><Excluded>0</Excluded></Member><Member MemberName="DefaultInvariant"><MemberSignature Language="C#" Value="public static readonly System.Collections.Comparer DefaultInvariant;" /><MemberSignature Language="ILAsm" Value=".field public static initonly class System.Collections.Comparer DefaultInvariant" /><MemberType>Field</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Collections.Comparer</ReturnType></ReturnValue><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>Comparison procedures use the <see cref="P:System.Globalization.CultureInfo.InvariantCulture" /> to determine the sort order and casing rules. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the <see cref="N:System.Globalization" /> namespace and <format type="text/html"><a href="9a59696b-d89b-45bd-946d-c75da4732d02">Encoding and Localization</a></format>.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Represents an instance of <see cref="T:System.Collections.Comparer" /> that is associated with <see cref="P:System.Globalization.CultureInfo.InvariantCulture" />. This field is read-only.</para></summary></Docs></Member><Member MemberName="GetObjectData"><MemberSignature Language="C#" Value="public void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void GetObjectData(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" /><Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>While the <see cref="M:System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" /> method is not visible to COM clients by default, inheriting the <see cref="T:System.Collections.Comparer" /> class can expose it and can cause undesirable behavior in COM clients.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object with the data required for serialization.  </para></summary><param name="info"><attribution license="cc4" from="Microsoft" modified="false" />The object to populate with data.</param><param name="context"><attribution license="cc4" from="Microsoft" modified="false" />The context information about the source or destination of the serialization.</param></Docs></Member></Members><TypeExcluded>0</TypeExcluded></Type>