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.Reflection;
\r
17 public abstract class ParameterDescriptor : ICustomAttributeProvider {
\r
19 private static readonly EmptyParameterBindingInfo _emptyBindingInfo = new EmptyParameterBindingInfo();
\r
21 public abstract ActionDescriptor ActionDescriptor {
\r
25 public virtual ParameterBindingInfo BindingInfo {
\r
27 return _emptyBindingInfo;
\r
31 public virtual object DefaultValue {
\r
37 public abstract string ParameterName {
\r
41 public abstract Type ParameterType {
\r
45 public virtual object[] GetCustomAttributes(bool inherit) {
\r
46 return GetCustomAttributes(typeof(object), inherit);
\r
49 public virtual object[] GetCustomAttributes(Type attributeType, bool inherit) {
\r
50 if (attributeType == null) {
\r
51 throw new ArgumentNullException("attributeType");
\r
54 return (object[])Array.CreateInstance(attributeType, 0);
\r
57 public virtual bool IsDefined(Type attributeType, bool inherit) {
\r
58 if (attributeType == null) {
\r
59 throw new ArgumentNullException("attributeType");
\r
65 private sealed class EmptyParameterBindingInfo : ParameterBindingInfo {
\r