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

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

PropertyInfo.PropertyType プロパティ

このプロパティの型を取得します

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

Public MustOverride ReadOnly
 Property PropertyType As Type
Dim instance As PropertyInfo
Dim value As Type

value = instance.PropertyType
public abstract Type PropertyType { get; }
/** @property */
public abstract Type get_PropertyType ()

プロパティ
このプロパティの型。

解説解説

型は、StringBooleanInt32 などです。

PropertyType プロパティ取得するには、最初に Type クラス取得します。そして、その Type から PropertyInfo取得します最後にPropertyInfo から PropertyType取得します

使用例使用例

指定したプロパティデータ型表示する例を次に示します

Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic

Namespace MyNamespace
    Public Class Example
        Public ReadOnly Property
 Answer As Integer
            Get
                Return 42
            End Get
        End Property

        Public Shared Sub
 Main()
            ' Get a Type object for the Example type.
            Dim t As Type = GetType(MyNamespace.Example)
 

            ' Get a PropertyInfo object for the Answer property.
            Dim pi As PropertyInfo = t.GetProperty("Answer")

            ' Display the type returned by the Answer property.
            Console.WriteLine("The return type of the {0}.{1}
 property is {2}.", _
                t.Name, pi.Name, pi.PropertyType)

        End Sub
    End Class
End Namespace
using System;
using System.Reflection;

namespace MyNamespace
{
    public class Example
    {
        public int Answer        
        {
            get
            {
                return 42;
            }
        }

        public static void
 Main()
        {
            // Get a Type object for the Example type.
            Type t = typeof(MyNamespace.Example);

            // Get a PropertyInfo object for the Answer property.
            PropertyInfo pi = t.GetProperty("Answer");

            // Display the type returned by the Answer property.
            Console.WriteLine("The return type of the {0}.{1}
 property is {2}.",
                t.Name, pi.Name, pi.PropertyType);
        }
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

_PropertyInfo.PropertyType プロパティ

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

COM オブジェクトに、PropertyType プロパティへのバージョン依存しないアクセス用意されています。

このプロパティは、CLS準拠していません。  

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

Dim instance As _PropertyInfo
Dim value As Type

value = instance.PropertyType
Type PropertyType { get; }
property Type^ PropertyType {
    Type^ get ();
}
/** @property */
Type get_PropertyType ()
function get PropertyType () : Type

プロパティ
このプロパティの型。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
_PropertyInfo インターフェイス
_PropertyInfo メンバ
System.Runtime.InteropServices 名前空間


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS