VCCodeParameter.Index 属性

定义

获取参数在参数列表中的位置。

public:
 property int Index { int get(); };
public:
 property int Index { int get(); };
[System.Runtime.InteropServices.DispId(579)]
public int Index { [System.Runtime.InteropServices.DispId(579)] get; }
[<System.Runtime.InteropServices.DispId(579)>]
[<get: System.Runtime.InteropServices.DispId(579)>]
member this.Index : int
Public ReadOnly Property Index As Integer

属性值

Int32

参数在参数列表中的位置。

属性

示例

此示例假设项目中存在名为的类 AClassWithAttributes ,并且它具有特性块。

Sub ReturnAllAttributes()  
        Dim cm As VCCodeModel  
        cm = DTE.Solution.Item(1).CodeModel  
        Dim cl As VCCodeClass  
        cl = cm.Classes.Item("AClassWithAttributes")  
        Dim att As VCCodeAttribute  
        For Each att In cl.Attributes  
            MsgBox(att.Name + " " + att.Index.ToString())  
        Next  
End Sub  

注解

Index属性是从1开始的。 属性的初始值 Index 为1。 每当成功匹配时,它的值就会发生更改。

适用于