Udostępnij za pośrednictwem


Właściwość CodeAttributeArgument.Value —

Ustawia lub zwraca wartość argumentu atrybutu.

Przestrzeń nazw:  EnvDTE80
Zestaw:  EnvDTE80 (w EnvDTE80.dll)

Składnia

'Deklaracja
Property Value As String
string Value { get; set; }
property String^ Value {
    String^ get ();
    void set (String^ value);
}
abstract Value : string with get, set
function get Value () : String 
function set Value (value : String)

Wartość właściwości

Typ: String
Ciąg reprezentujący wartość argumentu atrybutu.

Uwagi

[!UWAGA]

Po dokonaniu niektórych rodzajów modyfikacji, co oznacza, że ich wartości nie może polegać na zawsze pozostawać taki sam może być nie deterministyczny wartości elementów modelu kodu, takich jak klasy, strukturach, funkcje, atrybuty, delegatów i tak dalej.Aby uzyskać więcej informacji, zobacz sekcję wartości elementu modelu kod można zmienić w Odnajdowanie kodu za pomocą modelu kodu (Visual Basic).

Przykłady

' Macro code.
Sub codeArgExample()
    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 & " "
        Next
    Next
    ' List the arguments for the attribute.
    MsgBox("Attribute parameters for " & attr.Name _
    & ": " & msg)
End Sub

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

CodeAttributeArgument Interfejs

Przestrzeń nazw EnvDTE80

Inne zasoby

Porady: kompilowanie i uruchamianie kodu modelu obiektów automatyzacji — przykłady

Odnajdowanie kodu za pomocą modelu kodu (Visual Basic)

Odnajdowanie kodu za pomocą modelu kodu (Visual C#)