setting all protected methods on WizardStepPage as virtual
[castle.git] / MonoRail / Castle.MonoRail.Framework / Adapters / FileDictionaryAdapter.cs
blobcd08749cea534dca445299d17394976b356d7d58
1 // Copyright 2004-2008 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.MonoRail.Framework.Adapters
17 using System;
18 using System.Web;
19 using System.Collections;
21 /// <summary>
22 /// Adapts the ASP.Net HttpFileCollection to MonoRail dictionary
23 /// </summary>
24 public class FileDictionaryAdapter : IDictionary
26 private HttpFileCollection fileCollection;
28 /// <summary>
29 /// Initializes a new instance of the <see cref="FileDictionaryAdapter"/> class.
30 /// </summary>
31 /// <param name="fileCollection">The file collection.</param>
32 public FileDictionaryAdapter(HttpFileCollection fileCollection)
34 this.fileCollection = fileCollection;
37 /// <summary>
38 /// Determines whether the <see cref="T:System.Collections.IDictionary"></see> object contains an element with the specified key.
39 /// </summary>
40 /// <param name="key">The key to locate in the <see cref="T:System.Collections.IDictionary"></see> object.</param>
41 /// <returns>
42 /// true if the <see cref="T:System.Collections.IDictionary"></see> contains an element with the key; otherwise, false.
43 /// </returns>
44 /// <exception cref="T:System.ArgumentNullException">key is null. </exception>
45 public bool Contains(object key)
47 return fileCollection[(String) key] != null;
50 /// <summary>
51 /// Adds an element with the provided key and value to the <see cref="T:System.Collections.IDictionary"></see> object.
52 /// </summary>
53 /// <param name="key">The <see cref="T:System.Object"></see> to use as the key of the element to add.</param>
54 /// <param name="value">The <see cref="T:System.Object"></see> to use as the value of the element to add.</param>
55 /// <exception cref="T:System.ArgumentException">An element with the same key already exists in the <see cref="T:System.Collections.IDictionary"></see> object. </exception>
56 /// <exception cref="T:System.ArgumentNullException">key is null. </exception>
57 /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.IDictionary"></see> is read-only.-or- The <see cref="T:System.Collections.IDictionary"></see> has a fixed size. </exception>
58 public void Add(object key, object value)
60 throw new NotImplementedException();
63 /// <summary>
64 /// Removes all elements from the <see cref="T:System.Collections.IDictionary"></see> object.
65 /// </summary>
66 /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.IDictionary"></see> object is read-only. </exception>
67 public void Clear()
69 throw new NotImplementedException();
72 /// <summary>
73 /// Returns an <see cref="T:System.Collections.IDictionaryEnumerator"></see> object for the <see cref="T:System.Collections.IDictionary"></see> object.
74 /// </summary>
75 /// <returns>
76 /// An <see cref="T:System.Collections.IDictionaryEnumerator"></see> object for the <see cref="T:System.Collections.IDictionary"></see> object.
77 /// </returns>
78 IDictionaryEnumerator IDictionary.GetEnumerator()
80 Hashtable copy = new Hashtable();
82 foreach(String key in fileCollection.AllKeys)
84 copy[key] = fileCollection[key];
87 return copy.GetEnumerator();
90 /// <summary>
91 /// Removes the element with the specified key from the <see cref="T:System.Collections.IDictionary"></see> object.
92 /// </summary>
93 /// <param name="key">The key of the element to remove.</param>
94 /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.IDictionary"></see> object is read-only.-or- The <see cref="T:System.Collections.IDictionary"></see> has a fixed size. </exception>
95 /// <exception cref="T:System.ArgumentNullException">key is null. </exception>
96 public void Remove(object key)
98 throw new NotImplementedException();
101 /// <summary>
102 /// Gets an <see cref="T:System.Collections.ICollection"></see> object containing the keys of the <see cref="T:System.Collections.IDictionary"></see> object.
103 /// </summary>
104 /// <value></value>
105 /// <returns>An <see cref="T:System.Collections.ICollection"></see> object containing the keys of the <see cref="T:System.Collections.IDictionary"></see> object.</returns>
106 public ICollection Keys
108 get { return fileCollection.Keys; }
111 /// <summary>
112 /// Gets an <see cref="T:System.Collections.ICollection"></see> object containing the values in the <see cref="T:System.Collections.IDictionary"></see> object.
113 /// </summary>
114 /// <value></value>
115 /// <returns>An <see cref="T:System.Collections.ICollection"></see> object containing the values in the <see cref="T:System.Collections.IDictionary"></see> object.</returns>
116 public ICollection Values
118 get { throw new NotImplementedException(); }
121 /// <summary>
122 /// Gets a value indicating whether the <see cref="T:System.Collections.IDictionary"></see> object is read-only.
123 /// </summary>
124 /// <value></value>
125 /// <returns>true if the <see cref="T:System.Collections.IDictionary"></see> object is read-only; otherwise, false.</returns>
126 public bool IsReadOnly
128 get { return true; }
131 /// <summary>
132 /// Gets a value indicating whether the <see cref="T:System.Collections.IDictionary"></see> object has a fixed size.
133 /// </summary>
134 /// <value></value>
135 /// <returns>true if the <see cref="T:System.Collections.IDictionary"></see> object has a fixed size; otherwise, false.</returns>
136 public bool IsFixedSize
138 get { return true; }
141 /// <summary>
142 /// Gets or sets the <see cref="System.Object"/> with the specified key.
143 /// </summary>
144 /// <value></value>
145 public object this[object key]
147 get { return fileCollection[(String) key]; }
148 set { throw new NotImplementedException(); }
151 /// <summary>
152 /// Copies the elements of the <see cref="T:System.Collections.ICollection"></see> to an <see cref="T:System.Array"></see>, starting at a particular <see cref="T:System.Array"></see> index.
153 /// </summary>
154 /// <param name="array">The one-dimensional <see cref="T:System.Array"></see> that is the destination of the elements copied from <see cref="T:System.Collections.ICollection"></see>. The <see cref="T:System.Array"></see> must have zero-based indexing.</param>
155 /// <param name="index">The zero-based index in array at which copying begins.</param>
156 /// <exception cref="T:System.ArgumentNullException">array is null. </exception>
157 /// <exception cref="T:System.ArgumentOutOfRangeException">index is less than zero. </exception>
158 /// <exception cref="T:System.ArgumentException">array is multidimensional.-or- index is equal to or greater than the length of array.-or- The number of elements in the source <see cref="T:System.Collections.ICollection"></see> is greater than the available space from index to the end of the destination array. </exception>
159 /// <exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.ICollection"></see> cannot be cast automatically to the type of the destination array. </exception>
160 public void CopyTo(Array array, int index)
162 throw new NotImplementedException();
165 /// <summary>
166 /// Gets the number of elements contained in the <see cref="T:System.Collections.ICollection"></see>.
167 /// </summary>
168 /// <value></value>
169 /// <returns>The number of elements contained in the <see cref="T:System.Collections.ICollection"></see>.</returns>
170 public int Count
172 get { return fileCollection.Count; }
175 /// <summary>
176 /// Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"></see>.
177 /// </summary>
178 /// <value></value>
179 /// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"></see>.</returns>
180 public object SyncRoot
182 get { return this.SyncRoot; }
185 /// <summary>
186 /// Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection"></see> is synchronized (thread safe).
187 /// </summary>
188 /// <value></value>
189 /// <returns>true if access to the <see cref="T:System.Collections.ICollection"></see> is synchronized (thread safe); otherwise, false.</returns>
190 public bool IsSynchronized
192 get { return false; }
195 /// <summary>
196 /// Returns an enumerator that iterates through a collection.
197 /// </summary>
198 /// <returns>
199 /// An <see cref="T:System.Collections.IEnumerator"></see> object that can be used to iterate through the collection.
200 /// </returns>
201 public IEnumerator GetEnumerator()
203 return fileCollection.GetEnumerator();