This documentation is archived and is not being maintained.
CodeTypeReferenceExpression Class
Visual Studio 2008
Represents a reference to a data type.
Assembly: System (in System.dll)
CodeTypeReferenceExpression can be used to reference a particular data type.
The Type property specifies the data type to reference.
The following example demonstrates use of a CodeTypeReferenceExpression to represent a reference to a type.
' Creates an expression referencing the System.DateTime type. Dim typeRef1 As new CodeTypeReferenceExpression("System.DateTime") ' Create a Visual Basic code provider Dim provider As CodeDomProvider = CodeDomProvider.CreateProvider("VisualBasic") ' Generate code and send the output to the console provider.GenerateCodeFromExpression(typeRef1, Console.Out, New CodeGeneratorOptions()) ' The code generator produces the following source code for the preceeding example code: ' Date
System.Object
System.CodeDom.CodeObject
System.CodeDom.CodeExpression
System.CodeDom.CodeTypeReferenceExpression
System.CodeDom.CodeObject
System.CodeDom.CodeExpression
System.CodeDom.CodeTypeReferenceExpression
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: