PageRenderTime 36ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 1ms

/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
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace System.Collections
  5. {
  6. // [Serializable, ComVisible(true)]
  7. public abstract class ReadOnlyCollectionBase : ICollection, IEnumerable
  8. {
  9. // Fields
  10. private ArrayList list;
  11. // Methods
  12. protected ReadOnlyCollectionBase()
  13. {
  14. }
  15. public virtual IEnumerator GetEnumerator()
  16. {
  17. return this.InnerList.GetEnumerator();
  18. }
  19. void ICollection.CopyTo(Array array, int index)
  20. {
  21. this.InnerList.CopyTo(array, index);
  22. }
  23. // Properties
  24. public virtual int Count
  25. {
  26. get
  27. {
  28. return this.InnerList.Count;
  29. }
  30. }
  31. protected ArrayList InnerList
  32. {
  33. get
  34. {
  35. if (this.list == null)
  36. {
  37. this.list = new ArrayList();
  38. }
  39. return this.list;
  40. }
  41. }
  42. bool ICollection.IsSynchronized
  43. {
  44. get
  45. {
  46. return this.InnerList.IsSynchronized;
  47. }
  48. }
  49. object ICollection.SyncRoot
  50. {
  51. get
  52. {
  53. return this.InnerList.SyncRoot;
  54. }
  55. }
  56. }
  57. }