CodeTypeOfExpression クラスとは? わかりやすく解説

CodeTypeOfExpression クラス

指定した型名Type返す式である、typeof 式を表します

名前空間: System.CodeDom
アセンブリ: System (system.dll 内)
構文構文

<SerializableAttribute> _
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<ComVisibleAttribute(True)> _
Public Class CodeTypeOfExpression
    Inherits CodeExpression
Dim instance As CodeTypeOfExpression
[SerializableAttribute] 
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] 
[ComVisibleAttribute(true)] 
public class CodeTypeOfExpression : CodeExpression
[SerializableAttribute] 
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] 
[ComVisibleAttribute(true)] 
public ref class CodeTypeOfExpression : public
 CodeExpression
/** @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
解説解説

実行時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.Object
   System.CodeDom.CodeObject
     System.CodeDom.CodeExpression
      System.CodeDom.CodeTypeOfExpression
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CodeTypeOfExpression メンバ
System.CodeDom 名前空間
CodeTypeReferenceExpression


このページでは「.NET Framework クラス ライブラリ リファレンス」からCodeTypeOfExpression クラスを検索した結果を表示しています。
Weblioに収録されているすべての辞書からCodeTypeOfExpression クラスを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からCodeTypeOfExpression クラス を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「CodeTypeOfExpression クラス」の関連用語

CodeTypeOfExpression クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CodeTypeOfExpression クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS