public sealed class OutAttribute : Attribute
Object
Attribute
OutAttribute
mscorlib
RuntimeInfrastructure
Indicates that a parameter will be marshaled from the callee back to the caller.
[Note: The InAttribute and OutAttribute are not required. In the absence of explicit settings, the system assumes that all arguments passed by reference are passedin
/out
and that all non-reference parameters arein
. The only exception is the StringBuilder class, which is always assumed to bein
/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.
AttributeUsageAttribute(AttributeTargets.Parameter, AllowMultiple=false, Inherited=false)
System.Runtime.InteropServices Namespace
OutAttribute Constructors
public OutAttribute();
Constructs and initializes a new instance of the OutAttribute class.
System.Runtime.InteropServices.OutAttribute Class, System.Runtime.InteropServices Namespace