CodeFieldReferenceExpression Class
Represents a reference to a field.
For a list of all members of this type, see CodeFieldReferenceExpression Members.
System.Object
System.CodeDom.CodeObject
System.CodeDom.CodeExpression
System.CodeDom.CodeFieldReferenceExpression
[Visual Basic] <Serializable> <ClassInterface(ClassInterfaceType.AutoDispatch)> <ComVisible(True)> Public Class CodeFieldReferenceExpression Inherits CodeExpression [C#] [Serializable] [ClassInterface(ClassInterfaceType.AutoDispatch)] [ComVisible(true)] public class CodeFieldReferenceExpression : CodeExpression [C++] [Serializable] [ClassInterface(ClassInterfaceType::AutoDispatch)] [ComVisible(true)] public __gc class CodeFieldReferenceExpression : public CodeExpression [JScript] public Serializable ClassInterface(ClassInterfaceType.AutoDispatch) ComVisible(true) class CodeFieldReferenceExpression extends CodeExpression
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Remarks
CodeFieldReferenceExpression can be used to represent a reference to a field.
The TargetObject property specifies the object that contains the field. The FieldName property specifies the name of the field to reference.
Example
[Visual Basic, C#, C++] The following example demonstrates use of a CodeFieldReferenceExpression to reference a field.
[Visual Basic] Dim fieldRef1 As New CodeFieldReferenceExpression(New CodeThisReferenceExpression(), "TestField") ' A Visual Basic code generator produces the following source code for the preceeding example code: ' Me.TestField [C#] CodeFieldReferenceExpression fieldRef1 = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), "TestField"); // A C# code generator produces the following source code for the preceeding example code: // this.TestField [C++] CodeFieldReferenceExpression* fieldRef1 = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), S"TestField"); // A C# code generator produces the following source code for the preceeding example code: // this.TestField
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Namespace: System.CodeDom
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Assembly: System (in System.dll)
See Also
CodeFieldReferenceExpression Members | System.CodeDom Namespace