Export (0) Print
Expand All

VCCodeAttribute Object

Visual Studio .NET 2003

An object providing access to the attribute of an item.

[Visual Basic .NET]
Public Interface VCCodeAttribute
   Inherits IDispatch
[Visual Basic 6]
Class VCCodeAttribute
[C++]
interface VCCodeAttribute : IDispatch
[C#]
public interface VCCodeAttribute : IDispatch
[JScript .NET]
public interface VCCodeAttribute extends IDispatch

Remarks

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

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

Requirements

Namespace: Microsoft.VisualStudio.VCCodeModel

File: vcpkg.dll

Example

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.

See Also

VCCodeAttribute Object Properties, Methods, and Events | Visual C++ Extensibility Object Model

Show:
© 2014 Microsoft