Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CodeAttributeArgument Interface
Collapse the table of content
Expand the table of content

CodeAttributeArgument Interface

Represents a single argument (name/value pair) in a code attribute.

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

[GuidAttribute("80F4779B-835D-4873-8356-2F34A759A514")]
public interface CodeAttributeArgument

The CodeAttributeArgument type exposes the following members.

  NameDescription
Public propertyChildrenGets the collection of child attributes for the specified code attribute argument.
Public propertyCollectionGets the collection containing the object that supports this property.
Public propertyDTEGets the top-level extensibility object, in this case the DTE2 object.
Public propertyEndPointGets a TextPoint object defining the end of the code attribute argument.
Public propertyExtenderReturns the Extender for the code attribute argument.
Public propertyExtenderCATIDGets the category ID (CATID) for the Extender of the code attribute argument.
Public propertyExtenderNamesGets the names of the Extenders for the code attribute arguments.
Public propertyFullNameGets the fully qualified name of the code attribute argument's definition.
Public propertyInfoLocationGets a constant indicating the location of the code attribute argument.
Public propertyIsCodeTypeGets a value indicating whether a CodeType object can be obtained from this code attribute argument.
Public propertyKindGets an enumeration value that defines the type of code element.
Public propertyLanguageGets the programming language that is used to author the code.
Public propertyNameGets or sets a string representing the name of the object.
Public propertyProjectItemGets the associated ProjectItem object.
Public propertyStartPointGets a TextPoint object defining the start of the code attribute argument.
Public propertyValueSets or gets the value of an attribute argument.
Top

  NameDescription
Public methodDeleteRemoves a single argument from a code attribute.
Public methodGetEndPointReturns a TextPoint object that marks the end of the attribute argument.
Public methodGetStartPointGets a TextPoint object that marks the start of the attribute argument.
Top

All arguments for a code attribute are contained in the Collection property.

NoteNote

The values of code model elements such as classes, structs, functions, attributes, delegates, and so forth can be non-deterministic after making certain kinds of edits, meaning that their values cannot be relied upon to always remain the same. For more information, see the section Code Model Element Values Can Change in Discovering Code by Using the Code Model (Visual Basic).

' 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

Community Additions

ADD
Show:
© 2015 Microsoft