Proprietà CodeAttributeArgument.EndPoint

Ottiene un oggetto TextPoint oggetto che definisce la fine dell'argomento dell'attributo del codice.

Spazio dei nomi:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Sintassi

'Dichiarazione
ReadOnly Property EndPoint As TextPoint
TextPoint EndPoint { get; }
property TextPoint^ EndPoint {
    TextPoint^ get ();
}
abstract EndPoint : TextPoint
function get EndPoint () : TextPoint

Valore proprietà

Tipo: EnvDTE.TextPoint
In TextPoint oggetto che definisce la fine dell'argomento dell'attributo del codice.

Note

La posizione del punto finale viene immediatamente successiva all'ultimo carattere dell'argomento dell'attributo del codice (virgola di separazione incluso).

[!NOTA]

I valori degli elementi del modello di codice come classi, strutture, le funzioni, gli attributi, delegati, e così via possono non essere deterministici dopo l'inserimento di determinati tipi di modifiche, pertanto i relativi valori non possono essere basati su per rimanere sempre gli stessi.Per ulteriori informazioni, vedere i valori degli elementi del modello di codice della sezione può cambiare in Individuazione di codice mediante il modello di codice (Visual Basic).

Esempi

' 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

Sicurezza di .NET Framework

Vedere anche

Riferimenti

CodeAttributeArgument Interfaccia

Spazio dei nomi EnvDTE80

StartPoint

GetEndPoint

GetStartPoint