TypeBuilder.GetGenericTypeDefinition メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TypeBuilder.GetGenericTypeDefinition メソッドの意味・解説 

TypeBuilder.GetGenericTypeDefinition メソッド

メモ : このメソッドは、.NET Framework version 2.0 で新しく追加されたものです。

現在の型を取得できるジェネリック型の定義を表す Type オブジェクトを返します。

名前空間: System.Reflection.Emit
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Overrides Function
 GetGenericTypeDefinition As Type
Dim instance As TypeBuilder
Dim returnValue As Type

returnValue = instance.GetGenericTypeDefinition
public override Type GetGenericTypeDefinition ()
public:
virtual Type^ GetGenericTypeDefinition () override
public Type GetGenericTypeDefinition ()
public override function GetGenericTypeDefinition
 () : Type

戻り値
現在の型を取得できるジェネリック型の定義を表す Type オブジェクト。

例外例外
例外の種類条件

InvalidOperationException

現在の型はジェネリック型ではありません。つまり、IsGenericType は false を返します。

解説解説

IsGenericType プロパティが true を返す TypeBuilder オブジェクトに対して、GetGenericTypeDefinition メソッドを呼び出した場合、GetGenericTypeDefinition プロパティは現在のインスタンスを返します。ジェネリック型を表す TypeBuilder は、常にジェネリック型の定義です。

MakeGenericType メソッドを使用して、ジェネリック型の定義を表す TypeBuilder オブジェクトからジェネリック型を構築した場合、構築された型で Type.GetGenericTypeDefinition メソッドを使用すると、そのジェネリック型の定義を表す TypeBuilder オブジェクトを再び取得します。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TypeBuilder クラス
TypeBuilder メンバ
System.Reflection.Emit 名前空間
Type.IsGenericType
Type.GetGenericTypeDefinition
MakeGenericType



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

TypeBuilder.GetGenericTypeDefinition メソッドのお隣キーワード
検索ランキング

   

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



TypeBuilder.GetGenericTypeDefinition メソッドのページの著作権

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

©2026 GRAS Group, Inc.RSS