Added container accessor to Castle.Core
[castle.git] / Core / Castle.Core / Model / ParameterModelCollection.cs
blob50245cc8fb38947c6c32f7b765a896a45e0e18fe
1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
2 //
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
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
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.
15 namespace Castle.Core
17 using System;
18 using System.Collections;
19 using Castle.Core.Configuration;
21 /// <summary>
22 /// Collection of <see cref="ParameterModel"/>
23 /// </summary>
24 [Serializable]
25 public class ParameterModelCollection : IEnumerable
27 private Hashtable dictionary;
29 /// <summary>
30 /// Initializes a new instance of the <see cref="ParameterModelCollection"/> class.
31 /// </summary>
32 public ParameterModelCollection()
34 dictionary = new Hashtable(StringComparer.CurrentCultureIgnoreCase);
37 /// <summary>
38 /// Adds the specified name.
39 /// </summary>
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));
47 /// <summary>
48 /// Adds the specified name.
49 /// </summary>
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));
57 /// <summary>
58 /// Determines whether this collection contains the specified key.
59 /// </summary>
60 /// <param name="key">The key.</param>
61 /// <returns>
62 /// <c>true</c> if yes; otherwise, <c>false</c>.
63 /// </returns>
64 public bool Contains(object key)
66 return dictionary.Contains(key);
69 /// <summary>
70 /// Adds the specified key.
71 /// </summary>
72 /// <remarks>
73 /// Not implemented
74 /// </remarks>
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();
82 /// <summary>
83 /// Clears this instance.
84 /// </summary>
85 /// <remarks>
86 /// Not implemented
87 /// </remarks>
88 public void Clear()
90 throw new NotImplementedException();
93 /// <summary>
94 /// Removes the specified key.
95 /// </summary>
96 /// <param name="key">The key.</param>
97 /// <remarks>
98 /// Not implemented
99 /// </remarks>
100 public void Remove(object key)
102 throw new NotImplementedException();
105 /// <summary>
106 /// Gets the keys.
107 /// </summary>
108 /// <value>The keys.</value>
109 /// <remarks>
110 /// Not implemented
111 /// </remarks>
112 public ICollection Keys
114 get { throw new NotImplementedException(); }
117 /// <summary>
118 /// Gets the values.
119 /// </summary>
120 /// <value>The values.</value>
121 /// <remarks>
122 /// Not implemented
123 /// </remarks>
124 public ICollection Values
126 get { throw new NotImplementedException(); }
129 /// <summary>
130 /// Gets a value indicating whether this instance is read only.
131 /// </summary>
132 /// <value>
133 /// <c>true</c> if this instance is read only; otherwise, <c>false</c>.
134 /// </value>
135 public bool IsReadOnly
137 get { return dictionary.IsReadOnly; }
140 /// <summary>
141 /// Gets a value indicating whether this instance is fixed size.
142 /// </summary>
143 /// <value>
144 /// <c>true</c> if this instance is fixed size; otherwise, <c>false</c>.
145 /// </value>
146 public bool IsFixedSize
148 get { return dictionary.IsFixedSize; }
151 /// <summary>
152 /// Gets the <see cref="ParameterModel"/> with the specified key.
153 /// </summary>
154 /// <value></value>
155 public ParameterModel this[object key]
157 get { return (ParameterModel) dictionary[key]; }
160 /// <summary>
161 /// Copy the content to the specified array
162 /// </summary>
163 /// <param name="array">target array</param>
164 /// <param name="index">target index</param>
165 /// <remarks>
166 /// Not implemented
167 /// </remarks>
168 public void CopyTo(Array array, int index)
170 throw new NotImplementedException();
173 /// <summary>
174 /// Gets the count.
175 /// </summary>
176 /// <value>The count.</value>
177 public int Count
179 get { return dictionary.Count; }
182 /// <summary>
183 /// Gets the sync root.
184 /// </summary>
185 /// <value>The sync root.</value>
186 public object SyncRoot
188 get { return dictionary.SyncRoot; }
191 /// <summary>
192 /// Gets a value indicating whether this instance is synchronized.
193 /// </summary>
194 /// <value>
195 /// <c>true</c> if this instance is synchronized; otherwise, <c>false</c>.
196 /// </value>
197 public bool IsSynchronized
199 get { return dictionary.IsSynchronized; }
202 /// <summary>
203 /// Returns an enumerator that can iterate through a collection.
204 /// </summary>
205 /// <returns>
206 /// An <see cref="T:System.Collections.IEnumerator"/>
207 /// that can be used to iterate through the collection.
208 /// </returns>
209 public IEnumerator GetEnumerator()
211 return dictionary.Values.GetEnumerator();