Cosmos/source/Cosmos.IL2CPU/MethodBaseComparer.cs
2014-11-26 01:13:58 +00:00

29 lines
714 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
namespace Cosmos.IL2CPU
{
public class MethodBaseComparer : IComparer<MethodBase>, IEqualityComparer<MethodBase>
{
#region IComparer<MethodBase> Members
public int Compare(MethodBase x, MethodBase y)
{
return x.GetFullName().CompareTo(y.GetFullName());
}
#endregion
public bool Equals(MethodBase x, MethodBase y)
{
return Compare(x, y) == 0;
}
public int GetHashCode(MethodBase obj)
{
return obj.GetFullName().GetHashCode();
}
}
}