1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
18 using System
.Collections
;
19 using Castle
.Core
.Configuration
;
22 /// Collection of <see cref="ParameterModel"/>
25 public class ParameterModelCollection
: IEnumerable
27 private Hashtable dictionary
;
30 /// Initializes a new instance of the <see cref="ParameterModelCollection"/> class.
32 public ParameterModelCollection()
34 dictionary
= new Hashtable(StringComparer
.CurrentCultureIgnoreCase
);
38 /// Adds the specified name.
40 /// <param name="name">The name.</param>
41 /// <param name="value">The value.</param>
42 public void Add(String name
, String
value)
44 dictionary
.Add(name
, new ParameterModel(name
, value));
48 /// Adds the specified name.
50 /// <param name="name">The name.</param>
51 /// <param name="configNode">The config node.</param>
52 public void Add(String name
, IConfiguration configNode
)
54 dictionary
.Add(name
, new ParameterModel(name
, configNode
));
58 /// Determines whether this collection contains the specified key.
60 /// <param name="key">The key.</param>
62 /// <c>true</c> if yes; otherwise, <c>false</c>.
64 public bool Contains(object key
)
66 return dictionary
.Contains(key
);
70 /// Adds the specified key.
75 /// <param name="key">The key.</param>
76 /// <param name="value">The value.</param>
77 public void Add(object key
, object value)
79 throw new NotImplementedException();
83 /// Clears this instance.
90 throw new NotImplementedException();
94 /// Removes the specified key.
96 /// <param name="key">The key.</param>
100 public void Remove(object key
)
102 throw new NotImplementedException();
108 /// <value>The keys.</value>
112 public ICollection Keys
114 get { throw new NotImplementedException(); }
120 /// <value>The values.</value>
124 public ICollection Values
126 get { throw new NotImplementedException(); }
130 /// Gets a value indicating whether this instance is read only.
133 /// <c>true</c> if this instance is read only; otherwise, <c>false</c>.
135 public bool IsReadOnly
137 get { return dictionary.IsReadOnly; }
141 /// Gets a value indicating whether this instance is fixed size.
144 /// <c>true</c> if this instance is fixed size; otherwise, <c>false</c>.
146 public bool IsFixedSize
148 get { return dictionary.IsFixedSize; }
152 /// Gets the <see cref="ParameterModel"/> with the specified key.
155 public ParameterModel
this[object key
]
157 get { return (ParameterModel) dictionary[key]; }
161 /// Copy the content to the specified array
163 /// <param name="array">target array</param>
164 /// <param name="index">target index</param>
168 public void CopyTo(Array array
, int index
)
170 throw new NotImplementedException();
176 /// <value>The count.</value>
179 get { return dictionary.Count; }
183 /// Gets the sync root.
185 /// <value>The sync root.</value>
186 public object SyncRoot
188 get { return dictionary.SyncRoot; }
192 /// Gets a value indicating whether this instance is synchronized.
195 /// <c>true</c> if this instance is synchronized; otherwise, <c>false</c>.
197 public bool IsSynchronized
199 get { return dictionary.IsSynchronized; }
203 /// Returns an enumerator that can iterate through a collection.
206 /// An <see cref="T:System.Collections.IEnumerator"/>
207 /// that can be used to iterate through the collection.
209 public IEnumerator
GetEnumerator()
211 return dictionary
.Values
.GetEnumerator();