Applying patch from Jonathon Rossi
[castle.git] / Experiments / MVC / Castle.MVC / Controllers / PropertyControllerCollection.cs
blob2c10b18975a68c8133233a649a2e0e3128b6d863
1 #region Apache Notice
2 /*****************************************************************************
3 *
4 * Castle.MVC
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 ********************************************************************************/
19 #endregion
21 using System.Collections;
23 namespace Castle.MVC.Controllers
25 /// <summary>
26 /// Description résumée de PairCollection.
27 /// </summary>
28 public class PropertyControllerCollection: CollectionBase
30 /// <summary>
31 /// Constructeur
32 /// </summary>
33 public PropertyControllerCollection() {}
37 /// <summary>
38 /// Accès a un élément de la collection par son index
39 /// </summary>
40 public PropertyController this[int index]
42 get { return (PropertyController)List[index]; }
43 set { List[index] = value; }
46 /// <summary>
47 /// Ajoute un(e) Charge
48 /// </summary>
49 public int Add(PropertyController value)
51 return List.Add(value);
54 /// <summary>
55 /// Ajoute une liste de Charge à la collection
56 /// </summary>
57 public void AddRange(PropertyController[] value)
59 for (int i = 0; i < value.Length; i++)
61 Add(value[i]);
65 /// <summary>
66 /// Ajoute une liste de Charge à la collection
67 /// </summary>
68 public void AddRange(PropertyControllerCollection value)
70 for (int i = 0; i < value.Count; i++)
72 Add(value[i]);
76 /// <summary>
77 /// Indique si un(e) Charge appartient à la collection
78 /// </summary>
79 /// <param name="value">Un(e) Charge</param>
80 /// <returns>Renvoir vrai s'il/elle appartinet à la collection</returns>
81 public bool Contains(PropertyController value)
83 return List.Contains(value);
87 /// <summary>
88 /// Copie la collection dans un tableau de Charge
89 /// </summary>
90 /// <param name="array">Un tableau de Charge</param>
91 /// <param name="index">Index de début de la copie dans le tableau</param>
92 public void CopyTo(PropertyController[] array, int index)
94 List.CopyTo(array, index);
97 /// <summary>
98 /// Donne la position de l'agent dans la collection.
99 /// </summary>
100 /// <param name="value">Un(e) Charge</param>
101 /// <returns>L'index de l'élément dans la collection.</returns>
102 public int IndexOf(PropertyController value)
104 return List.IndexOf(value);
107 /// <summary>
108 /// Insére un(e) Charge dans la collection.
109 /// </summary>
110 /// <param name="index">L'index d'insertion dans la collection.</param>
111 /// <param name="value">Un(e) Charge</param>
112 public void Insert(int index, PropertyController value)
114 List.Insert(index, value);
117 /// <summary>
118 /// Enléve un(e) Charge de la collection.
119 /// </summary>
120 public void Remove(PropertyController value)
122 List.Remove(value);