Added RedirectUsingNamedRoute
[castle.git] / Components / DictionaryAdapter / Castle.Components.DictionaryAdapter / AbstractDictionaryAdapter.cs
blob4403e2e34204b100b5e30a7e4d375561faac1698
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.Components.DictionaryAdapter
17 using System;
18 using System.Collections;
20 /// <summary>
21 /// Abstract adapter for the <see cref="IDictionary"/> support
22 /// needed by the <see cref="DictionaryAdapterFactory"/>
23 /// </summary>
24 public abstract class AbstractDictionaryAdapter : IDictionary
26 /// <summary>
27 /// Adds an element with the provided key and value to the <see cref="T:System.Collections.IDictionary"></see> object.
28 /// </summary>
29 /// <param name="key">The <see cref="T:System.Object"></see> to use as the key of the element to add.</param>
30 /// <param name="value">The <see cref="T:System.Object"></see> to use as the value of the element to add.</param>
31 /// <exception cref="T:System.ArgumentException">An element with the same key already exists in the <see cref="T:System.Collections.IDictionary"></see> object. </exception>
32 /// <exception cref="T:System.ArgumentNullException">key is null. </exception>
33 /// <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>
34 public void Add(object key, object value)
36 throw new NotSupportedException();
39 /// <summary>
40 /// Removes all elements from the <see cref="T:System.Collections.IDictionary"></see> object.
41 /// </summary>
42 /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.IDictionary"></see> object is read-only. </exception>
43 public void Clear()
45 throw new NotSupportedException();
48 /// <summary>
49 /// Determines whether the <see cref="T:System.Collections.IDictionary"></see> object contains an element with the specified key.
50 /// </summary>
51 /// <param name="key">The key to locate in the <see cref="T:System.Collections.IDictionary"></see> object.</param>
52 /// <returns>
53 /// true if the <see cref="T:System.Collections.IDictionary"></see> contains an element with the key; otherwise, false.
54 /// </returns>
55 /// <exception cref="T:System.ArgumentNullException">key is null. </exception>
56 public abstract bool Contains(object key);
58 /// <summary>
59 /// Returns an <see cref="T:System.Collections.IDictionaryEnumerator"></see> object for the <see cref="T:System.Collections.IDictionary"></see> object.
60 /// </summary>
61 /// <returns>
62 /// An <see cref="T:System.Collections.IDictionaryEnumerator"></see> object for the <see cref="T:System.Collections.IDictionary"></see> object.
63 /// </returns>
64 public IDictionaryEnumerator GetEnumerator()
66 throw new NotSupportedException();
69 /// <summary>
70 /// Gets a value indicating whether the <see cref="T:System.Collections.IDictionary"></see> object has a fixed size.
71 /// </summary>
72 /// <value></value>
73 /// <returns>true if the <see cref="T:System.Collections.IDictionary"></see> object has a fixed size; otherwise, false.</returns>
74 public bool IsFixedSize
76 get { throw new NotSupportedException(); }
79 /// <summary>
80 /// Gets a value indicating whether the <see cref="T:System.Collections.IDictionary"></see> object is read-only.
81 /// </summary>
82 /// <value></value>
83 /// <returns>true if the <see cref="T:System.Collections.IDictionary"></see> object is read-only; otherwise, false.</returns>
84 public abstract bool IsReadOnly { get; }
86 /// <summary>
87 /// Gets an <see cref="T:System.Collections.ICollection"></see> object containing the keys of the <see cref="T:System.Collections.IDictionary"></see> object.
88 /// </summary>
89 /// <value></value>
90 /// <returns>An <see cref="T:System.Collections.ICollection"></see> object containing the keys of the <see cref="T:System.Collections.IDictionary"></see> object.</returns>
91 public ICollection Keys
93 get { throw new NotSupportedException(); }
96 /// <summary>
97 /// Removes the element with the specified key from the <see cref="T:System.Collections.IDictionary"></see> object.
98 /// </summary>
99 /// <param name="key">The key of the element to remove.</param>
100 /// <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>
101 /// <exception cref="T:System.ArgumentNullException">key is null. </exception>
102 public void Remove(object key)
104 throw new NotSupportedException();
107 /// <summary>
108 /// Gets an <see cref="T:System.Collections.ICollection"></see> object containing the values in the <see cref="T:System.Collections.IDictionary"></see> object.
109 /// </summary>
110 /// <value></value>
111 /// <returns>An <see cref="T:System.Collections.ICollection"></see> object containing the values in the <see cref="T:System.Collections.IDictionary"></see> object.</returns>
112 public ICollection Values
114 get { throw new NotSupportedException(); }
117 /// <summary>
118 /// Gets or sets the <see cref="System.Object"/> with the specified key.
119 /// </summary>
120 /// <value></value>
121 public abstract object this[object key] { get; set; }
123 /// <summary>
124 /// 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.
125 /// </summary>
126 /// <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>
127 /// <param name="index">The zero-based index in array at which copying begins.</param>
128 /// <exception cref="T:System.ArgumentNullException">array is null. </exception>
129 /// <exception cref="T:System.ArgumentException">The type of the source <see cref="T:System.Collections.ICollection"></see> cannot be cast automatically to the type of the destination array. </exception>
130 /// <exception cref="T:System.ArgumentOutOfRangeException">index is less than zero. </exception>
131 /// <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>
132 public void CopyTo(Array array, int index)
134 throw new NotSupportedException();
137 /// <summary>
138 /// Gets the number of elements contained in the <see cref="T:System.Collections.ICollection"></see>.
139 /// </summary>
140 /// <value></value>
141 /// <returns>The number of elements contained in the <see cref="T:System.Collections.ICollection"></see>.</returns>
142 public int Count
144 get { throw new NotSupportedException(); }
147 /// <summary>
148 /// Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection"></see> is synchronized (thread safe).
149 /// </summary>
150 /// <value></value>
151 /// <returns>true if access to the <see cref="T:System.Collections.ICollection"></see> is synchronized (thread safe); otherwise, false.</returns>
152 public virtual bool IsSynchronized
154 get { return false; }
157 /// <summary>
158 /// Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"></see>.
159 /// </summary>
160 /// <value></value>
161 /// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"></see>.</returns>
162 public virtual object SyncRoot
164 get { return this; }
167 /// <summary>
168 /// Returns an enumerator that iterates through a collection.
169 /// </summary>
170 /// <returns>
171 /// An <see cref="T:System.Collections.IEnumerator"></see> object that can be used to iterate through the collection.
172 /// </returns>
173 IEnumerator IEnumerable.GetEnumerator()
175 throw new NotSupportedException();