Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

<Parameter> Element (.NET Native)

.NET Framework 4.6 and 4.5

Applies reflection policy to the type of the argument passed to a method.

<Parameter Name="parameter_name"
           Activate="policy_type"
           Browse="policy_type"
           Dynamic="policy_type"
           Serialize="policy_type"
           DataContractSerializer="policy_type"
           DataContractJsonSerializer="policy_type"
           XmlSerializer="policy_type"
           MarshalObject="policy_type"
           MarshalDelegate="policy_type"
           MarshalStructure="policy_type" />

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute type

Attribute

Description

General

Name

Required attribute. The parameter name. For example, for the method signature String.CompareTo(Object value), the value of the Name attribute is "value".

Reflection attributes

Activate

Optional attribute. Controls runtime access to constructors to enable activation of instances.

Browse

Optional attribute. Controls querying for information about program elements, but does not enable any runtime access.

Dynamic

Optional attribute. Controls runtime access to all type members, including constructors, methods, fields, properties, and events, to enable dynamic programming.

Serialization attributes

Serialize

Optional attribute. Controls runtime access to constructors, fields, and properties, to enable type instances to be serialized and deserialized by libraries such as the Newtonsoft JSON serializer.

DataContractSerializer

Optional attribute. Controls policy for serialization that uses the System.Runtime.Serialization.DataContractSerializer class.

DataContractJsonSerializer

Optional attribute. Controls policy for JSON serialization that uses the System.Runtime.Serialization.DataContractSerializer class.

XmlSerializer

Optional attribute. Controls policy for XML serialization that uses the System.Xml.Serialization.XmlSerializer class.

Interop attributes

MarshalObject

Optional attribute. Controls policy for marshaling reference types to WinRT and COM.

MarshalDelegate

Optional attribute. Controls policy for marshaling delegate types as function pointers to native code.

MarshalStructure

Optional attribute. Controls policy for marshaling value types to native code.

Name attribute

Value

Description

parameter_name

The name of the method parameter to which policy is applied. For example, for the method signature String.CompareTo(Object value), the value of the Name attribute is "value".

All other attributes

Value

Description

policy_setting

The setting to apply to this policy type. Possible values are All, Public, PublicAndInternal, Required Public, Required PublicAndInternal, and Required All. For more information, see Runtime Directive Policy Settings.

Child Elements

None.

Parent Elements

Element

Description

<Method>

Applies runtime reflection policy to a constructor or method.

The <Parameter> element is a child of the <Method> element and is used to apply policy to a particular method parameter. The specific method parameter is specified by name rather than by type. At least one attribute that represents a policy type, such as Activate or Dynamic, must be present.

Show:
© 2015 Microsoft