winform下,如何让自己写的类成为一个容器,需要从哪里类去继承?

解决方案 »

  1.   

        class MyContainer : ICollection
        {
            #region ICollection Members        public void CopyTo(Array array, int index)
            {
                throw new NotImplementedException();
            }        public int Count
            {
                get { throw new NotImplementedException(); }
            }        public bool IsSynchronized
            {
                get { throw new NotImplementedException(); }
            }        public object SyncRoot
            {
                get { throw new NotImplementedException(); }
            }        #endregion        #region IEnumerable Members        public IEnumerator GetEnumerator()
            {
                throw new NotImplementedException();
            }        #endregion
        }继承ICollection, 或ICollection<T>
      

  2.   

    c#能够这样么
    好象c#没有象java可以使用容器放对象的功能