| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- //
- // System.CodeDOM Code@CONTAINEE@Collection Class implementation
- //
- // Author:
- // Miguel de Icaza ([email protected])
- //
- // (C) 2001 Ximian, Inc.
- //
- namespace System.CodeDOM {
- using System.Collections;
-
- public class Code@CONTAINEE@Collection : IList, ICollection, IEnumerable {
- ArrayList @arrayname@;
-
- //
- // Constructors
- //
- public Code@CONTAINEE@Collection ()
- {
- @arrayname@ = new ArrayList ();
- }
- //
- // Properties
- //
- public int Count {
- get {
- return @[email protected];
- }
- }
- //
- // Methods
- //
- public void Add (Code@CONTAINEE@ value)
- {
- @[email protected] (value);
- }
- public void AddRange (Code@CONTAINEE@ [] values)
- {
- foreach (Code@CONTAINEE@ ca in values)
- @[email protected] (ca);
- }
- public void Clear ()
- {
- @[email protected] ();
- }
- private class Enumerator : IEnumerator {
- private Code@CONTAINEE@Collection collection;
- private int currentIndex = -1;
- internal Enumerator (Code@CONTAINEE@Collection collection)
- {
- this.collection = collection;
- }
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new Code@[email protected] (this);
- }
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return @[email protected] (value);
- }
- public bool Contains (Object value)
- {
- return @[email protected] (value);
- }
- public int IndexOf (Object value)
- {
- return @[email protected] (value);
- }
- public void Insert (int index, Object value)
- {
- @arrayname@ [index] = value;
- }
- public object this[int index] {
- get {
- return @arrayname@ [index];
- }
- set {
- @arrayname@ [index] = value;
- }
- }
- public void Remove (object value)
- {
- @[email protected] (value);
- }
- public void RemoveAt (int index)
- {
- @[email protected] (index);
- }
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- @[email protected] (array, index);
- }
- public object SyncRoot {
- get {
- return @[email protected];
- }
- }
- public bool IsReadOnly {
- get {
- return false;
- }
- }
- public bool IsSynchronized {
- get {
- return @[email protected];
- }
- }
- }
- }
|