コード例 #1
0
        public int CompareTo(object obj)         //нужна проверка на null и на соответствие типа (иначе as вернёт null)
        {
            People p = obj as People;

            return(string.Compare(this.Name, p.Name));
        }
コード例 #2
0
        public int CompareTo(object obj)
        {
            People p = obj as People;

            return(string.Compare(this.Name, p.Name));
        }