The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

VCCodeAttribute Interface

Provides access to an item attribute.

Namespace:  Microsoft.VisualStudio.VCCodeModel
Assembly:  Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)

public interface VCCodeAttribute

The VCCodeAttribute type exposes the following members.

Public propertyChildrenGets a collection of child code elements of the specified attribute.
Public propertyCodeModelGets the VCCodeModel object for the project.
Public propertyCollectionGets the collection containing the code element supporting this attribute.
Public propertyDisplayNameGets the full name of the attribute.
Public propertyDTEGets the top-level extensibility object.
Public propertyEndPointGets the edit point that is the location of the end of the code item.
Public propertyEndPointOfReturns the end point of the parent object.
Public propertyExtenderGets the requested Extender object if it is available for this object.
Public propertyExtenderCATIDGets the Extender category ID (CATID) for the object.
Public propertyExtenderNamesGets a list of available Extenders for the object.
Public propertyFileGets the file in which the parent object is declared.
Public propertyFullNameGets the full path and name of the object's file.
Public propertyIndexGets the position of an attribute in the attribute block.
Public propertyInfoLocationGets the capabilities of the code model.
Public propertyIsCaseSensitiveGets whether a code element is case-sensitive.
Public propertyIsCodeTypeGets a value indicating whether a CodeType object can be obtained from this object.
Public propertyIsInjectedDetermines if a code element has been injected by an attribute or macro expansion.
Public propertyIsReadOnlyGets whether the file containing the parent object is read-only.
Public propertyIsZombieGets whether the parent object exists.
Public propertyKindGets an enumeration indicating the type of object.
Public propertyLanguageGets the programming language used to author the code.
Public propertyLocationReturns the location of the parent object declaration.
Public propertyNameGets or sets the name of the object.
Public propertyParametersGets a collection of parameters for this item.
Public propertyParentGets the immediate parent object of a given object.
Public propertyPictureGets a picture automation object to be used as an icon in the user interface.
Public propertyProjectGets the Project associated with the object.
Public propertyProjectItemGets the ProjectItem associated with the given object.
Public propertyStartPointGets a TextPoint object that defines the beginning of the code item.
Public propertyStartPointOfReturns the start point of the parent object.
Public propertyValueGets or sets the data for the object.

Public methodAddParameterCreates a new parameter code construct and inserts the code in the correct location.
Public methodDeleteRemoves the attribute.
Public methodGetEndPointReturns a TextPoint object that marks the end of the code element definition.
Public methodGetStartPointReturns a TextPoint object that defines the beginning of the code element definition.
Public methodIsSelfDetermines if the specified code element is the same as the parent code element.
Public methodRemoveParameterRemoves a parameter from the argument list.

The VCCodeAttribute object represents either a CLR or COM metadata attribute associated with a code element. You can add new parameters to the attribute with the AddParameter method and get and set the value of a code attribute with the VCCodeAttribute object.


A large part of the functionality of this object is provided by the Visual Studio VCCodeAttribute object. For more information, see CodeAttribute object.

This example displays the names of all attributes applied to the ATLProjectLib library. It is assumed that the ATLProjectLib library exists.

    Sub GetAttributes()
        Dim vcCM As VCCodeModel
        Dim vcLibrary As VCCodeIDLLibrary
        Dim vcAttribute As VCCodeAttribute
        Dim i As Integer
        vcCM = DTE.Solution.Item(1).CodeModel
        vcLibrary = vcCM.IDLLibraries.Find("ATLProjectLib")
        For i = 1 To vcLibrary.Attributes.Count
            vcAttribute = vcLibrary.Attributes.Item(i)
    End Sub

See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft