VCCodeIDLCoClass.IsInjected - свойство
Gets a value indicating whether a code element has been injected by an attribute or macro expansion.
Пространство имен: Microsoft.VisualStudio.VCCodeModel
Сборка: Microsoft.VisualStudio.VCCodeModel (в Microsoft.VisualStudio.VCCodeModel.dll)
Синтаксис
'Декларация
ReadOnly Property IsInjected As Boolean
'Применение
Dim instance As VCCodeIDLCoClass
Dim value As Boolean
value = instance.IsInjected
bool IsInjected { get; }
property bool IsInjected {
bool get ();
}
function get IsInjected () : boolean
Значение свойства
Тип: System.Boolean
true if a code element has been injected by an attribute or macro expansion; otherwise, false.
Заметки
See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.
Примеры
This example iterates through all global VCCodeElement objects in a file and displays the name of those objects injected by attribute or macro expansions.
Sub InjectedObjects()
Dim vcCM As VCCodeModel
Dim vcCodeElement As VCCodeElement
vcCM = DTE.Solution.Item(1).CodeModel
For Each vcCodeElement In vcCM.CodeElements
If (vcCodeElement.IsInjected) Then
MsgBox(vcCodeElement.Name + " was injected.")
End If
Next
End Sub
Разрешения
- Полное доверие для непосредственно вызывающего метода. Этот член не может быть использован частично доверенным кодом. Дополнительные сведения см. в разделе Using Libraries from Partially Trusted Code.