Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Gets the position of an attribute in the attribute block.
Namespace: Microsoft.VisualStudio.VCCodeModel
Assembly: Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)
Syntax
'Declaration
ReadOnly Property Index As Integer
Get
int Index { get; }
property int Index {
int get ();
}
abstract Index : int
function get Index () : int
Property Value
Type: System.Int32
A value indicating the position of an attribute within the attribute block.
Remarks
The Index property is one-based. The initial value of the Index property is 1. Its value changes whenever a successful match is made.
Examples
This example assumes that a class named AClassWithAttributes exists in the project and that it has an attribute block.
' Macro code.
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 Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.