// // Copyright (c) ZeroC, Inc. All rights reserved. // using System; using System.Collections.Generic; namespace Ice { namespace seqMapping { public class Custom : IEnumerable { System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return _list.GetEnumerator(); } public IEnumerator GetEnumerator() { return _list.GetEnumerator(); } public int Count { get { return _list.Count; } } public T this[int index] { get { return _list[index]; } set { _list[index] = value; } } public void Add(T elmt) { _list.Add(elmt); } public override bool Equals(object o) { try { Custom tmp =(Custom)o; IEnumerator e = tmp.GetEnumerator(); foreach(T elmt in _list) { if(!e.MoveNext()) { return false; } if(elmt == null) { if(e.Current != null) { return false; } } else { if(!elmt.Equals(e.Current)) { return false; } } } return true; } catch(Exception) { return false; } } public override int GetHashCode() { return base.GetHashCode(); } private List _list = new List(); } } }