Export (0) Print
Expand All

VCCodeAttribute Interface 

Provides access to an item attribute.

Namespace: Microsoft.VisualStudio.VCCodeModel
Assembly: Microsoft.VisualStudio.VCCodeModel (in microsoft.visualstudio.vccodemodel.dll)

[GuidAttribute("17730D44-271F-11D7-8BF6-00B0D03DAA06")] 
public interface VCCodeAttribute
/** @attribute GuidAttribute("17730D44-271F-11D7-8BF6-00B0D03DAA06") */ 
public interface VCCodeAttribute
GuidAttribute("17730D44-271F-11D7-8BF6-00B0D03DAA06") 
public interface VCCodeAttribute

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.

NoteNote

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)
            MsgBox(vcAttribute.DisplayName)
        Next
    End Sub

See Samples for Code Model Extensibility for information on how to compile and run this sample.

Show:
© 2014 Microsoft