This documentation is archived and is not being maintained.
FieldDirection Enumeration
Visual Studio 2010
Defines identifiers used to indicate the direction of parameter and argument declarations.
Assembly: System (in System.dll)
The following example demonstrates use of FieldDirection to indicate the field direction types of the parameters of a method in a method declaration.
// Declares a method. CodeMemberMethod^ method1 = gcnew CodeMemberMethod; method1->Name = "TestMethod"; // Declares a string parameter passed by reference. CodeParameterDeclarationExpression^ param1 = gcnew CodeParameterDeclarationExpression( "System.String","stringParam" ); param1->Direction = FieldDirection::Ref; method1->Parameters->Add( param1 ); // Declares a Int32 parameter passed by incoming field. CodeParameterDeclarationExpression^ param2 = gcnew CodeParameterDeclarationExpression( "System.Int32","intParam" ); param2->Direction = FieldDirection::Out; method1->Parameters->Add( param2 ); // A C# code generator produces the following source code for the preceeding example code: // private void TestMethod(ref string stringParam, out int intParam) { // }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: