/// <summary> /// 相等与否 /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { TypedConfigItem <TKey, TValue> item = obj as TypedConfigItem <TKey, TValue>; if (item == null) { return(false); } return(item.Name.Equals(this.Name) && item.Value.Equals(this.Value)); }
/// <summary> /// 比较,默认以分组进行比较。 /// </summary> /// <param name="other"></param> /// <returns></returns> public int CompareTo(TypedConfigItem <TKey, TValue> other) { return(this.Name.ToString().CompareTo(other.Name.ToString())); }