Пример #1
0
        /// <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));
        }
Пример #2
0
 /// <summary>
 /// 比较,默认以分组进行比较。
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public int CompareTo(TypedConfigItem <TKey, TValue> other)
 {
     return(this.Name.ToString().CompareTo(other.Name.ToString()));
 }