Proprietà CodeAttributeArgument.Name

Ottiene o imposta una stringa che rappresenta il nome dell'oggetto.

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

Sintassi

'Dichiarazione
Default Property Name As String
    Get
    Set
string this { get; set; }
property String^ default {
    String^ get ();
    void set (String^ value);
}
abstract Name : string with get, set
function get Name () : String
function set Name (value : String)

Valore proprietà

Tipo: System.String
Stringa che rappresenta il nome dell'oggetto CodeAttributeArgument.

Note

Nota

I valori degli elementi del modello di codice, quali classi, strutture, funzioni, attributi, delegati e così via, possono non essere deterministici dopo alcuni tipi di modifiche. Ciò significa che non si può fare affidamento sulla stabilità di tali valori. Per ulteriori informazioni, vedere la sezione Possibile modifica dei valori degli elementi del modello di codice 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

    ' 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 += attrArg.Value & " " & vbCr
            ' If the argument has a name, list it.
            If attrArg.Name <> Nothing Then
                msg += "Name: " & attrArg.Name
            End If
        Next
    Next
    ' List the arguments for the attribute.
    MsgBox("Attribute parameters for " & attr.Name _
    & ": " & msg)
End Sub

Sicurezza di .NET Framework

Vedere anche

Riferimenti

CodeAttributeArgument Interfaccia

Spazio dei nomi EnvDTE80

Altre risorse

Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione

Individuazione di codice mediante il modello di codice (Visual Basic)

Individuazione di codice mediante il modello di codice (Visual C#)