1
Answer

about interface

mesut topuzlu

mesut topuzlu

16y
2.1k
1
Hi friends. i have researched metadata of Collectionbase class. the class inherited IList, ICollection, IEnumerable interfaces but didn't use some members in this interfaces. for example IndexOf methods in IList. What do you think about it?

metadata of collectionbase class:

namespace System.Collections

{

   

    public abstract class CollectionBase : IList, ICollection, IEnumerable

    {

        protected CollectionBase();

        protected CollectionBase(int capacity);

        public int Capacity { get; set; }

        public int Count { get; }

        protected ArrayList InnerList { get; }

        protected IList List { get; }

        public void Clear();

        public IEnumerator GetEnumerator();

       

        protected virtual void OnClear();

        protected virtual void OnClearComplete();

        protected virtual void OnInsert(int index, object value);

        protected virtual void OnInsertComplete(int index, object value);

        protected virtual void OnRemove(int index, object value);

        protected virtual void OnRemoveComplete(int index, object value);

       

        protected virtual void OnSet(int index, object oldValue, object newValue);

        protected virtual void OnSetComplete(int index, object oldValue, object newValue);

        protected virtual void OnValidate(object value);

       

        public void RemoveAt(int index);

    }

}


metadata of IList:


public interface IList : ICollection, IEnumerable

{

        bool IsFixedSize { get; }

        bool IsReadOnly { get; }

        object this[int index] { get; set; }

        int Add(object value);

        void Clear();

       

        bool Contains(object value);

        int IndexOf(object value);

        void Insert(int index, object value);

        void Remove(object value);

        void RemoveAt(int index);

 }

 

 


Answers (1)