/// <summary> /// 确定两个对象是否具有相同的值 /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { if (obj is ItemUnit) { ItemUnit aimObj = (ItemUnit)obj; return(aimObj.Name == Name); } return(false); }
/// <summary> /// 用传入的ItemUnit创建新的ItemUnit /// </summary> /// <param name="source"></param> public ItemUnit(ItemUnit source) : this(source.Name, source.Quotiety, source.Kind) { }