Type.IsGenericParameter プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Type.IsGenericParameter プロパティの意味・解説 

Type.IsGenericParameter プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

現在の Typeジェネリック型またはジェネリック メソッドの定義の型パラメータ表しているかどうかを示す値を取得します

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

Public Overridable ReadOnly
 Property IsGenericParameter As Boolean
Dim instance As Type
Dim value As Boolean

value = instance.IsGenericParameter
public virtual bool IsGenericParameter { get;
 }
public:
virtual property bool IsGenericParameter {
    bool get ();
}
/** @property */
public boolean get_IsGenericParameter ()
public function get IsGenericParameter
 () : boolean

プロパティ
Type オブジェクトジェネリック型定義またはジェネリック メソッド定義の型パラメータ表している場合trueそれ以外場合false

解説解説
使用例使用例

IsGenericParameter プロパティ使用してジェネリック型ジェネリック型パラメータテストする例を次に示します

If t.IsGenericType Then
    ' If this is a generic type, display the type arguments.
    '
    Dim typeArguments As Type() = t.GetGenericArguments()
    
    Console.WriteLine(vbTab & "List type arguments ("
 _
        & typeArguments.Length & "):")
    
    For Each tParam As Type
 In typeArguments
        ' If this is a type parameter, display its position.
        '
        If tParam.IsGenericParameter Then
            Console.WriteLine(vbTab & vbTab & tParam.ToString() _
                & vbTab & "(unassigned - parameter position
 " _
                & tParam.GenericParameterPosition & ")")
        Else
            Console.WriteLine(vbTab & vbTab & tParam.ToString())
        End If
    Next tParam
End If
if (t.IsGenericType)
{
    // If this is a generic type, display the type arguments.
    //
    Type[] typeArguments = t.GetGenericArguments();

    Console.WriteLine("\tList type arguments ({0}):", 
        typeArguments.Length);

    foreach (Type tParam in typeArguments)
    {
        // If this is a type parameter, display its
        // position.
        //
        if (tParam.IsGenericParameter)
        {
            Console.WriteLine("\t\t{0}\t(unassigned - parameter position {1})"
,
                tParam,
                tParam.GenericParameterPosition);
        }
        else
        {
            Console.WriteLine("\t\t{0}", tParam);
        }
    }
}
if ( t->IsGenericType )
{
   
   // If this is a generic type, display the type arguments.
   //
   array<Type^>^typeArguments = t->GetGenericArguments();
   Console::WriteLine( L"\tList type arguments ({0}):",
      typeArguments->Length );
   System::Collections::IEnumerator^ myEnum =
      typeArguments->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      Type^ tParam = safe_cast<Type^>(myEnum->Current);
      
      // If this is a type parameter, display its
      // position.
      //
      if ( tParam->IsGenericParameter )
      {
         Console::WriteLine(
            L"\t\t{0}\t(unassigned - parameter position {1})",
            tParam, tParam->GenericParameterPosition );
      }
      else
      {
         Console::WriteLine( L"\t\t{0}", tParam );
      }
   }
}
if (t.get_IsGenericType()) {
    // If this is a generic type, display the type arguments.
    Type typeArguments[] = t.GetGenericArguments();
    Console.WriteLine("\tList type arguments ({0}):",
        (Int32)typeArguments.get_Length());
    for (int iCtr = 0; iCtr < typeArguments.get_Length();
 iCtr++) {
        Type tParam = typeArguments[iCtr];
        // If this is a type parameter, display its
        // position.
        
        if (tParam.get_IsGenericParameter()) {
            Console.WriteLine("\t\t{0}\t(unassigned - parameter "
                + "position {1})", tParam, 
                (Int32)tParam.get_GenericParameterPosition());
        }
        else {
            Console.WriteLine("\t\t{0}", tParam);
        }
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「Type.IsGenericParameter プロパティ」の関連用語

Type.IsGenericParameter プロパティのお隣キーワード
検索ランキング

   

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



Type.IsGenericParameter プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS