CodeTypeOfExpression Class
.NET Framework 2.0
Represents a typeof expression, an expression that returns a Type for a specified type name.
Namespace: System.CodeDom
Assembly: System (in system.dll)
Assembly: System (in system.dll)
'Declaration <SerializableAttribute> _ <ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _ <ComVisibleAttribute(True)> _ Public Class CodeTypeOfExpression Inherits CodeExpression 'Usage Dim instance As CodeTypeOfExpression
/** @attribute SerializableAttribute() */ /** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ /** @attribute ComVisibleAttribute(true) */ public class CodeTypeOfExpression extends CodeExpression
SerializableAttribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) ComVisibleAttribute(true) public class CodeTypeOfExpression extends CodeExpression
Not applicable.
A CodeTypeOfExpression represents a typeof expression that returns a Type at runtime.
The Type property specifies the data type to return a Type object for.
Use CodeTypeReferenceExpression to represent source code that refers to a type by name, such as when creating a CodeCastExpression to cast an object to a name-specified type.
The following example demonstrates use of a CodeTypeOfExpression to represent a typeof expression.
' Creates a reference to the System.DateTime type. Dim typeRef1 As New CodeTypeReference("System.DateTime") ' Creates a typeof expression for the specified type reference. Dim typeof1 As New CodeTypeOfExpression(typeRef1) ' A Visual Basic code generator produces the following source code for the preceeding example code: ' GetType(System.DateTime)
// Creates a reference to the System.DateTime type.
CodeTypeReference typeRef1 = new CodeTypeReference("System.DateTime");
// Creates a typeof expression for the specified type reference.
CodeTypeOfExpression typeof1 = new CodeTypeOfExpression(typeRef1);
// A VJ# code generator produces the following source code for the
// preceeding example code:
// System.DateTime.class.ToType();
System.Object
System.CodeDom.CodeObject
System.CodeDom.CodeExpression
System.CodeDom.CodeTypeOfExpression
System.CodeDom.CodeObject
System.CodeDom.CodeExpression
System.CodeDom.CodeTypeOfExpression
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: