CodeTypeOfExpression クラス
アセンブリ: System (system.dll 内)

<SerializableAttribute> _ <ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _ <ComVisibleAttribute(True)> _ Public Class CodeTypeOfExpression Inherits CodeExpression
[SerializableAttribute] [ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] [ComVisibleAttribute(true)] public class CodeTypeOfExpression : CodeExpression
[SerializableAttribute] [ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] [ComVisibleAttribute(true)] public ref class CodeTypeOfExpression : public CodeExpression

実行時に Type を返す typeof 式を表す、CodeTypeOfExpression。
Type プロパティは、Type オブジェクトを返すデータ型を指定します。
CodeTypeReferenceExpression を使用すると、CodeCastExpression を作成して名前を指定した型にオブジェクトをキャストするときのように、名前によって型を参照するソース コードを表すことができます。

CodeTypeOfExpression を使用して typeof 式を表す例を次に示します。
' 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 C# code generator produces the following source code for the preceeding example code: // typeof(System.DateTime);
// Creates a reference to the System.DateTime type. CodeTypeReference^ typeRef1 = gcnew CodeTypeReference( "System.DateTime" ); // Creates a typeof expression for the specified type reference. CodeTypeOfExpression^ typeof1 = gcnew CodeTypeOfExpression( typeRef1 ); // A C# code generator produces the following source code for the preceeding example code: // typeof(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.CodeDom.CodeObject
System.CodeDom.CodeExpression
System.CodeDom.CodeTypeOfExpression


Windows 98, Windows 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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- CodeTypeOfExpression クラスのページへのリンク