VCCodeParameter.Index 属性

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

命名空间:  Microsoft.VisualStudio.VCCodeModel
程序集:  Microsoft.VisualStudio.VCCodeModel(在 Microsoft.VisualStudio.VCCodeModel.dll 中)

语法

声明
ReadOnly Property Index As Integer
int Index { get; }
property int Index {
    int get ();
}
abstract Index : int with get
function get Index () : int

属性值

类型:Int32
该参数在参数列表中的位置。

备注

从一开始 Index 属性。 Index 属性的初始值是 1。 更改其值,只要成功匹配进行。

示例

此示例假定中,名为 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

.NET Framework 安全性

请参阅

参考

VCCodeParameter 接口

Microsoft.VisualStudio.VCCodeModel 命名空间