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 ValueProviderFactoryCollection : Collection<ValueProviderFactory> {
\r
21 public ValueProviderFactoryCollection() {
\r
24 public ValueProviderFactoryCollection(IList<ValueProviderFactory> list)
\r
28 public IValueProvider GetValueProvider(ControllerContext controllerContext) {
\r
29 var valueProviders = from factory in this
\r
30 let valueProvider = factory.GetValueProvider(controllerContext)
\r
31 where valueProvider != null
\r
32 select valueProvider;
\r
34 return new ValueProviderCollection(valueProviders.ToList());
\r
38 protected override void InsertItem(int index, ValueProviderFactory item) {
\r
40 throw new ArgumentNullException("item");
\r
42 base.InsertItem(index, item);
\r
45 protected override void SetItem(int index, ValueProviderFactory item) {
\r
47 throw new ArgumentNullException("item");
\r
49 base.SetItem(index, item);
\r