标签:compareto try this throw str except return his message
class MenuInfo : IComparable
{
public int order { get; set; }
public string menuid { get; set; }
public int CompareTo(object obj)
{
int result;
try
{
MenuInfo menuInfo = obj as MenuInfo;
if (this.order >= menuInfo.order)
{
result = 1;
}
else
{
result = -1;
}
return result;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
}
标签:compareto try this throw str except return his message
原文地址:https://www.cnblogs.com/whisful/p/12303924.html