次の方法で共有


VCCodeProperty インターフェイス

更新 : 2007 年 11 月

プロパティ コード要素 (__property キーワードで宣言) を表すオブジェクト。

名前空間 :  Microsoft.VisualStudio.VCCodeModel
アセンブリ :  Microsoft.VisualStudio.VCCodeModel (Microsoft.VisualStudio.VCCodeModel.dll 内)

構文

'宣言
<GuidAttribute("17730D5B-271F-11D7-8BF6-00B0D03DAA06")> _
Public Interface VCCodeProperty
'使用
Dim instance As VCCodeProperty
[GuidAttribute("17730D5B-271F-11D7-8BF6-00B0D03DAA06")]
public interface VCCodeProperty
[GuidAttribute(L"17730D5B-271F-11D7-8BF6-00B0D03DAA06")]
public interface class VCCodeProperty
public interface VCCodeProperty

解説

VCCodeProperty オブジェクトは、ソース ファイル内のプロパティ コード要素を表します。このオブジェクトを使用して、特定のプロパティ コード要素に関する情報にアクセスできます。

ms167871.alert_note(ja-jp,VS.90).gifメモ :

このオブジェクトが持つ機能の大部分は、Visual StudioCodeProperty オブジェクトによって提供されます。詳細については、CodeProperty オブジェクトを参照してください。

このサンプル コードをコンパイルして実行する方法については、「方法 : Visual C++ コード モデル機能拡張のプログラム例をコンパイルする」を参照してください。

この例は、最初のクラスのプロパティをすべて取得し、イベント名をメッセージ ボックスに表示します。

Sub GetProperties()
    Dim vcCM As VCCodeModel
    Dim vcClass As VCCodeClass
    Dim vcProperty as VCCodeProperty
    vcCM = DTE.Solution.Item(1).CodeModel
    vcClass = vcCM.Classes.Item(1)
    For Each vcProperty in vcClass.Properties
        MsgBox(vcProperty.DisplayName)
    Next
End Sub

参照

参照

VCCodeProperty メンバ

Microsoft.VisualStudio.VCCodeModel 名前空間