public class PersonComparerName : IComparer
{
public static IComparer Default = new PersonComparerName();//这一行看不懂
public int Compare(object x, object y)
{
if (x is Person && y is Person)
{
return Comparer.Default.Compare(((Person)x).Name, ((Person)y).Name);
}
else
{
throw new ArgumentException(".....");
}
}
}
PIPIONE
相关分类