System.Runtime.InteropServices.OutAttribute Class

public sealed class OutAttribute : Attribute

Base Types

Object
  Attribute
    OutAttribute

Assembly

mscorlib

Library

RuntimeInfrastructure

Summary

Indicates that a parameter will be marshaled from the callee back to the caller.

Description

[Note: The InAttribute and OutAttribute are not required. In the absence of explicit settings, the system assumes that all arguments passed by reference are passed in /out and that all non-reference parameters are in . The only exception is the StringBuilder class, which is always assumed to be in /out . The InAttribute and OutAttribute are particularly useful when applied to formatted types that cannot be block-copied. Since these types require copying during marshaling, you can use InAttribute and OutAttribute to eliminate the generation of unnecessary copies.]

Compilers are required to not preserve this type in metadata as a custom attribute. Instead, compilers are required to emit it directly in the file format, as described in Partition II of the CLI Specification. Metadata consumers, such as the Reflection API, are required to retrieve this data from the file format and return it as if it were a custom attribute.

Attributes

AttributeUsageAttribute(AttributeTargets.Parameter, AllowMultiple=false, Inherited=false)

See Also

System.Runtime.InteropServices Namespace

Members

OutAttribute Constructors

OutAttribute Constructor


OutAttribute Constructor

public OutAttribute();

Summary

Constructs and initializes a new instance of the OutAttribute class.

See Also

System.Runtime.InteropServices.OutAttribute Class, System.Runtime.InteropServices Namespace