1 /* ****************************************************************************
\r
3 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
5 * This software is subject to the Microsoft Public License (Ms-PL).
\r
6 * A copy of the license can be found in the license.htm file included
\r
7 * in this distribution.
\r
9 * You must not remove this notice, or any other, from this software.
\r
11 * ***************************************************************************/
\r
13 namespace System.Web.Mvc {
\r
15 using System.Collections.Generic;
\r
16 using System.Collections.ObjectModel;
\r
19 public class ModelValidatorProviderCollection : Collection<ModelValidatorProvider> {
\r
21 public ModelValidatorProviderCollection() {
\r
24 public ModelValidatorProviderCollection(IList<ModelValidatorProvider> list)
\r
28 protected override void InsertItem(int index, ModelValidatorProvider item) {
\r
30 throw new ArgumentNullException("item");
\r
32 base.InsertItem(index, item);
\r
35 protected override void SetItem(int index, ModelValidatorProvider item) {
\r
37 throw new ArgumentNullException("item");
\r
39 base.SetItem(index, item);
\r
42 public IEnumerable<ModelValidator> GetValidators(ModelMetadata metadata, ControllerContext context) {
\r
43 return this.SelectMany(provider => provider.GetValidators(metadata, context));
\r