Applied patch from Jan Limpens 'ReflectionBasedDictionaryAdapter needs to check if...
[castle.git] / Core / Castle.Core / Model / DependencyModelCollection.cs
blob211c17aa1f6c82c52c2b71598d53d4d3d60afe49
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.Core
17 using System;
18 using System.Collections;
20 /// <summary>
21 /// Collection of <see cref="DependencyModel"/>.
22 /// </summary>
23 #if !SILVERLIGHT
24 [Serializable]
25 #endif
26 public class DependencyModelCollection : ReadOnlyCollectionBase
28 /// <summary>
29 /// Initializes a new instance of the <see cref="DependencyModelCollection"/> class.
30 /// </summary>
31 public DependencyModelCollection()
35 /// <summary>
36 /// Initializes a new instance of the <see cref="DependencyModelCollection"/> class.
37 /// </summary>
38 /// <param name="dependencies">The dependencies.</param>
39 public DependencyModelCollection(DependencyModelCollection dependencies)
41 InnerList.AddRange(dependencies);
44 /// <summary>
45 /// Initializes a new instance of the <see cref="DependencyModelCollection"/> class.
46 /// </summary>
47 /// <param name="dependencies">The dependencies.</param>
48 public DependencyModelCollection(DependencyModel[] dependencies)
50 InnerList.AddRange(dependencies);
53 /// <summary>
54 /// Adds the specified model.
55 /// </summary>
56 /// <param name="model">The model.</param>
57 public void Add(DependencyModel model)
59 InnerList.Add(model);
62 /// <summary>
63 /// Removes the specified model.
64 /// </summary>
65 /// <param name="model">The model.</param>
66 public void Remove(DependencyModel model)
68 InnerList.Remove(model);
71 /// <summary>
72 /// Clears this instance.
73 /// </summary>
74 public void Clear()
76 InnerList.Clear();
79 /// <summary>
80 /// Determines whether this collection contains the the specified model.
81 /// </summary>
82 /// <param name="model">The model.</param>
83 /// <returns>
84 /// <c>true</c> if the collection contains the specified model; otherwise, <c>false</c>.
85 /// </returns>
86 public bool Contains(DependencyModel model)
88 return InnerList.Contains(model);