VCCodeAttribute - интерфейс
Provides access to an item attribute.
Пространство имен: Microsoft.VisualStudio.VCCodeModel
Сборка: Microsoft.VisualStudio.VCCodeModel (в Microsoft.VisualStudio.VCCodeModel.dll)
Синтаксис
'Декларация
<GuidAttribute("17730D44-271F-11D7-8BF6-00B0D03DAA06")> _
Public Interface VCCodeAttribute
'Применение
Dim instance As VCCodeAttribute
[GuidAttribute("17730D44-271F-11D7-8BF6-00B0D03DAA06")]
public interface VCCodeAttribute
[GuidAttribute(L"17730D44-271F-11D7-8BF6-00B0D03DAA06")]
public interface class VCCodeAttribute
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.
Примечание. |
---|
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 How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.