CodeAttributeArgument インターフェイス
更新 : 2007 年 11 月
コード属性の 1 つの引数 (名前/値ペア) を表します。
名前空間 : EnvDTE80
アセンブリ : EnvDTE80 (EnvDTE80.dll 内)
構文
'宣言
<GuidAttribute("80F4779B-835D-4873-8356-2F34A759A514")> _
Public Interface CodeAttributeArgument
'使用
Dim instance As CodeAttributeArgument
[GuidAttribute("80F4779B-835D-4873-8356-2F34A759A514")]
public interface CodeAttributeArgument
[GuidAttribute(L"80F4779B-835D-4873-8356-2F34A759A514")]
public interface class CodeAttributeArgument
public interface CodeAttributeArgument
解説
コード属性のすべての引数は、Collection プロパティに含まれています。
メモ : |
---|
特定の種類の編集を行うと、クラス、構造体、関数、属性、デリゲートなどのコード モデル要素が非確定的な値になる場合があります。つまり、これらの要素の値は、常に同じ値になるとは限りません。詳細については、「コード モデルを使用したコードの調査 (Visual Basic)」の「変更されるコード モデル要素値」を参照してください。 |
例
' Macro code.
Sub codeArgExample()
Dim sel As TextSelection = _
CType(DTE.ActiveDocument.Selection, TextSelection)
Dim cls As CodeClass2 = CType(sel.ActivePoint. _
CodeElement(vsCMElement.vsCMElementClass), CodeClass2)
Dim attr As CodeAttribute2
Dim attrArg As CodeAttributeArgument
Dim msg As String
' Loop through all of the attributes in the class.
For Each attr In cls.Attributes
' Loop through all of the arguments for the attribute.
For Each attrArg In attr.Arguments
msg += attrArg.Value & " "
Next
Next
' List the arguments for the attribute.
MsgBox("Attribute parameters for " & attr.Name _
& ": " & msg)
End Sub
参照
参照
その他の技術情報
方法 : オートメーション オブジェクト モデルのコード例をコンパイルおよび実行する