1
/* ****************************************************************************
3 * Copyright (c) Microsoft Corporation. All rights reserved.
5 * This software is subject to the Microsoft Public License (Ms-PL).
6 * A copy of the license can be found in the license.htm file included
7 * in this distribution.
9 * You must not remove this notice, or any other, from this software.
11 * ***************************************************************************/
13 namespace System
.Web
.Mvc
{
15 using System
.Reflection
;
17 public class ReflectedParameterDescriptor
: ParameterDescriptor
{
19 private readonly ActionDescriptor _actionDescriptor
;
20 private readonly ReflectedParameterBindingInfo _bindingInfo
;
22 public ReflectedParameterDescriptor(ParameterInfo parameterInfo
, ActionDescriptor actionDescriptor
) {
23 if (parameterInfo
== null) {
24 throw new ArgumentNullException("parameterInfo");
26 if (actionDescriptor
== null) {
27 throw new ArgumentNullException("actionDescriptor");
30 ParameterInfo
= parameterInfo
;
31 _actionDescriptor
= actionDescriptor
;
32 _bindingInfo
= new ReflectedParameterBindingInfo(parameterInfo
);
35 public override ActionDescriptor ActionDescriptor
{
37 return _actionDescriptor
;
41 public override ParameterBindingInfo BindingInfo
{
47 public ParameterInfo ParameterInfo
{
52 public override string ParameterName
{
54 return ParameterInfo
.Name
;
58 public override Type ParameterType
{
60 return ParameterInfo
.ParameterType
;
64 public override object[] GetCustomAttributes(bool inherit
) {
65 return ParameterInfo
.GetCustomAttributes(inherit
);
68 public override object[] GetCustomAttributes(Type attributeType
, bool inherit
) {
69 return ParameterInfo
.GetCustomAttributes(attributeType
, inherit
);
72 public override bool IsDefined(Type attributeType
, bool inherit
) {
73 return ParameterInfo
.IsDefined(attributeType
, inherit
);