/System/System.Collections/ReadOnlyCollectionBase.cs
https://bitbucket.org/cosi2/dotnetanywhere-wb · C# · 67 lines · 53 code · 10 blank · 4 comment · 2 complexity · 93c7b5da3bb1905b38ae1a470d942e6b MD5 · raw file
- using System;
- using System.Collections.Generic;
- using System.Text;
-
- namespace System.Collections
- {
- // [Serializable, ComVisible(true)]
- public abstract class ReadOnlyCollectionBase : ICollection, IEnumerable
- {
- // Fields
- private ArrayList list;
-
- // Methods
- protected ReadOnlyCollectionBase()
- {
- }
-
- public virtual IEnumerator GetEnumerator()
- {
- return this.InnerList.GetEnumerator();
- }
-
- void ICollection.CopyTo(Array array, int index)
- {
- this.InnerList.CopyTo(array, index);
- }
-
- // Properties
- public virtual int Count
- {
- get
- {
- return this.InnerList.Count;
- }
- }
-
- protected ArrayList InnerList
- {
- get
- {
- if (this.list == null)
- {
- this.list = new ArrayList();
- }
- return this.list;
- }
- }
-
- bool ICollection.IsSynchronized
- {
- get
- {
- return this.InnerList.IsSynchronized;
- }
- }
-
- object ICollection.SyncRoot
- {
- get
- {
- return this.InnerList.SyncRoot;
- }
- }
- }
-
-
- }