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.Diagnostics.CodeAnalysis;
\r
16 using System.Reflection;
\r
18 public abstract class ParameterDescriptor : ICustomAttributeProvider {
\r
20 private static readonly EmptyParameterBindingInfo _emptyBindingInfo = new EmptyParameterBindingInfo();
\r
22 public abstract ActionDescriptor ActionDescriptor {
\r
26 public virtual ParameterBindingInfo BindingInfo {
\r
28 return _emptyBindingInfo;
\r
32 public abstract string ParameterName {
\r
36 public abstract Type ParameterType {
\r
40 [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
\r
41 public virtual object[] GetCustomAttributes(bool inherit) {
\r
42 return GetCustomAttributes(typeof(object), inherit);
\r
45 [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
\r
46 public virtual object[] GetCustomAttributes(Type attributeType, bool inherit) {
\r
47 if (attributeType == null) {
\r
48 throw new ArgumentNullException("attributeType");
\r
51 return (object[])Array.CreateInstance(attributeType, 0);
\r
54 [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
\r
55 public virtual bool IsDefined(Type attributeType, bool inherit) {
\r
56 if (attributeType == null) {
\r
57 throw new ArgumentNullException("attributeType");
\r
63 private sealed class EmptyParameterBindingInfo : ParameterBindingInfo {
\r