Compartilhar via


Propriedade CodeAttributeArgument.StartPoint

Obtém um TextPoint objeto que define o início do argumento de atributo de código.

Namespace:  EnvDTE80
Assembly:  EnvDTE80 (em EnvDTE80.dll)

Sintaxe

'Declaração
ReadOnly Property StartPoint As TextPoint
TextPoint StartPoint { get; }
property TextPoint^ StartPoint {
    TextPoint^ get ();
}
abstract StartPoint : TextPoint with get
function get StartPoint () : TextPoint

Valor de propriedade

Tipo: TextPoint
A TextPoint objeto que define o início do argumento de atributo de código.

Comentários

Dica

Os valores de elementos de modelo de código, como classes, estruturas, funções, atributos, delegados e assim por diante podem ser não-determinísticos depois de fazer determinados tipos de edições, o que significa que seus valores não confie sempre permanecer o mesmo.Para obter mais informações, consulte a seção valores de elemento de modelo de código podem ser alterada de Descobrindo código usando o modelo de código (Visual Basic).

Exemplos

' Macro code.
Sub codeArgNameExample()
    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

    Try
        ' 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 += "Value: " & attrArg.Value & " " & vbCr
                ' If the argument has a name, list it.
                If attrArg.Name <> Nothing Then
                    msg += "Name: " & attrArg.Name & vbCr
                End If
                msg += "Arg start pos: " & _
                attrArg.StartPoint.LineCharOffset & vbCr
                msg += "Arg end pos: " & _
                attrArg.EndPoint.LineCharOffset & vbCr
            Next
        Next
        msg += "Location: " & attrArg.InfoLocation.ToString & vbCr
        msg += "Is code type? " & attrArg.IsCodeType.ToString & vbCr
        msg += "Code element type: " & attrArg.Kind.ToString & vbCr
        msg += "Language: " & attrArg.Language & vbCr
        msg += ("Name of attribute's project item: " & _
        attrArg.ProjectItem.Name)
        ' List the arguments for the attribute.
        MsgBox("Attribute parameters for " & attr.Name _
        & ": " & vbCr & msg)
    Catch ex As System.Exception
        MsgBox("ERROR -> " & ex.Message)
    End Try
End Sub

Segurança do .NET Framework

Consulte também

Referência

CodeAttributeArgument Interface

Namespace EnvDTE80

EndPoint

GetEndPoint

GetStartPoint