2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / Microsoft.Web.Services / Microsoft.Web.Services.Routing / ViaCollection.cs
1 //
2 // Microsoft.Web.Services.Routing.ViaCollection.cs
3 //
4 // Author: Daniel Kornhauser <dkor@alum.mit.edu>
5 //
6 // Copyright (C) Ximian, Inc. 2003
7 //
8
9 using System;
10 using System.Collections;
11
12 namespace Microsoft.Web.Services.Routing {
13         
14         public class ViaCollection : ICollection, IEnumerable, ICloneable
15         {
16                 ArrayList list;
17
18                 public ViaCollection ()
19                 {
20                         list = new ArrayList ();
21                 }
22
23                 ViaCollection (ArrayList list)
24                 {
25                         this.list = list;
26                 }
27
28                                 
29                 public int Count { 
30                         get { return list.Count; }
31                 }
32
33
34                 public bool IsSynchronized {
35                         get { return list.IsSynchronized; }
36                 }
37
38
39                 public Via this [int filter] {
40                         get {
41                                 return (Via) list [filter];
42                         }
43                         set {
44                                 list[filter] = value;
45                         }
46
47                 }
48                 
49                 public virtual object SyncRoot {
50                         get {
51                                 return list.SyncRoot;
52                         }
53                 }
54                 
55                 public int Add (Via via)
56                 {
57                         return list.Add (via);
58                 }
59                 
60                 public virtual object Clone ()
61                 {
62                         return new ViaCollection (list);
63                 }
64
65                 public virtual void CopyTo (Array array, int index) 
66                 {
67                         list.CopyTo(array, index);
68                 }
69
70                 public virtual IEnumerator GetEnumerator () 
71                 {
72                         return list.GetEnumerator();
73                 }
74
75                 public void Insert (int index, Via via) 
76                 {
77                         list.Insert(index, via);
78                 }
79
80                 public void InsertRange (int index, ViaCollection collection) 
81                 {
82                         list.InsertRange(index, collection);
83                 }
84
85                 public void RemoveAt (int index)
86                 {
87                         list.RemoveAt(index);
88                 }
89         }
90 }